[BUGFIX] Color picker: Do not bind to document 62/49962/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sun, 18 Sep 2016 11:39:58 +0000 (13:39 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 19 Sep 2016 20:00:09 +0000 (22:00 +0200)
The event listening of the color picker was changed to
`[document, top.document]` with ticket #77317, but the inner events still
listen to `document`. This patch changes this to the delegator of the
event.

Resolves: #77980
Related: #77317
Releases: master
Change-Id: I24ab6e49dbf113e41ce7db42e6ba9ccf43e75d1d
Reviewed-on: https://review.typo3.org/49962
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Riccardo De Contardi <erredeco@gmail.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery.minicolors.js

index e87b511..e270092 100644 (file)
                .on('mousedown.minicolors touchstart.minicolors', '.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider', function(event) {
                        var target = $(this);
                        event.preventDefault();
-                       $(document).data('minicolors-target', target);
+                       $(event.delegateTarget).data('minicolors-target', target);
                        move(target, event, true);
                })
                // Move pickers
                .on('mousemove.minicolors touchmove.minicolors', function(event) {
-                       var target = $(document).data('minicolors-target');
+                       var target = $(event.delegateTarget).data('minicolors-target');
                        if( target ) move(target, event);
                })
                // Stop moving