Bug 1474142: Don't skip calling _onDragEnd even if the from and to target is the customizable area. r=Gijs

We may not really receive a dragend event if we're fast enough.

Calling _onDragEnd multiple times is fine (it should be idempotent).

This particular exception was added in bug 978084 along with all the _onDragEnd
calls, but I don't think it's sound over-all.

I don't really want to dig into the XUL button code to see why drag end was
consistently firing there, unless you think it's really really needed :)

Differential Revision: https://phabricator.services.mozilla.com/D2019

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2018-07-31 15:38:34 +00:00
parent d4fdced45f
commit 3deb38c4a8

View File

@ -1919,10 +1919,7 @@ CustomizeMode.prototype = {
// The items in the palette are wrapped, so we need the target node's parent here:
this.visiblePalette.insertBefore(draggedItem, aTargetNode.parentNode);
}
if (aOriginArea.id !== kPaletteId) {
// The dragend event already fires when the item moves within the palette.
this._onDragEnd(aEvent);
}
this._onDragEnd(aEvent);
return;
}
@ -2025,6 +2022,8 @@ CustomizeMode.prototype = {
/**
* To workaround bug 460801 we manually forward the drop event here when dragend wouldn't be fired.
*
* Note that that means that this function may be called multiple times by a single drag operation.
*/
_onDragEnd(aEvent) {
if (this._isUnwantedDragDrop(aEvent)) {