Unmark media after insertion
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:38:32 +0000 (13:38 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 11:44:15 +0000 (13:44 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js
wcfsetup/install/files/js/WoltLab/WCF/Media/Manager/Editor.js

index c467e760ee8e403ba95915d0363d2e0a7674bdf4..7369986da36e3d7c8321c33f552332eda02a524b 100644 (file)
@@ -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);
                }
        };
 });
index 4571f2dc39629a6466eddff5af452aa4a3e49536..6cd2f4bb5cab070fe2d2f0b67898bd8ca9e4804b 100644 (file)
@@ -6,7 +6,8 @@
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @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();