From 04d804f3e71482df1be0e88fa5c2770b3ac837cd Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 31 Jul 2016 13:38:32 +0200 Subject: [PATCH] Unmark media after insertion --- .../files/js/WoltLab/WCF/Controller/Clipboard.js | 10 ++++++++++ .../files/js/WoltLab/WCF/Media/Manager/Editor.js | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) 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(); -- 2.20.1