From: Matthias Schmidt Date: Sun, 31 Jul 2016 11:38:32 +0000 (+0200) Subject: Unmark media after insertion X-Git-Tag: 3.0.0_Beta_1~848 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=04d804f3e71482df1be0e88fa5c2770b3ac837cd;p=GitHub%2FWoltLab%2FWCF.git Unmark media after insertion --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js b/wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js index c467e760ee..7369986da3 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js @@ -618,6 +618,16 @@ define( _addPageOverlayActiveClass = true; } + }, + + /** + * Unmarks the objects with given clipboard object type and ids. + * + * @param {string} objectType + * @param {int[]} objectIds + */ + unmark: function(objectType, objectIds) { + this._saveState(objectType, objectIds, false); } }; }); diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Editor.js b/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Editor.js index 4571f2dc39..6cd2f4bb5c 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Editor.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Editor.js @@ -6,7 +6,8 @@ * @license GNU Lesser General Public License * @module WoltLab/WCF/Media/Manager/Editor */ -define(['Core', 'Dictionary', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLab/WCF/Media/Manager/Base'], function(Core, Dictionary, DomTraverse, Language, UiDialog, MediaManagerBase) { +define(['Core', 'Dictionary', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLab/WCF/Controller/Clipboard', 'WoltLab/WCF/Media/Manager/Base'], + function(Core, Dictionary, DomTraverse, Language, UiDialog, ControllerClipboard, MediaManagerBase) { "use strict"; /** @@ -196,7 +197,12 @@ define(['Core', 'Dictionary', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLab/ } if (this._mediaToInsertByClipboard) { - // TODO: unmark in clipboard + var mediaIds = []; + this._mediaToInsert.forEach(function(media) { + mediaIds.push(media.mediaID); + }) + + ControllerClipboard.unmark('com.woltlab.wcf.media', mediaIds); } this._mediaToInsert = new Dictionary();