Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/139673

Change subject: Trigger endRelocation on focusable drag end
......................................................................

Trigger endRelocation on focusable drag end

It isn't usually called, but if it is onDocumentDrop might not fire,
(e.g. dropping back on itself) so call endRelocation here. It doesn't
matter in endRelocation is called twice.

Change-Id: I259fbfb0fe122c1bad7ea49fb7f5684821eca452
---
M modules/ve/ce/ve.ce.FocusableNode.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/73/139673/1

diff --git a/modules/ve/ce/ve.ce.FocusableNode.js 
b/modules/ve/ce/ve.ce.FocusableNode.js
index 773206d..ca0c755 100644
--- a/modules/ve/ce/ve.ce.FocusableNode.js
+++ b/modules/ve/ce/ve.ce.FocusableNode.js
@@ -288,7 +288,11 @@
  * @param {jQuery.Event} e Drag end event
  */
 ve.ce.FocusableNode.prototype.onFocusableDragEnd = function () {
-       // endRelocation is triggered by onDocumentDrop in the surface
+       // endRelocation is usually triggered by onDocumentDrop in the surface, 
but if it isn't
+       // trigger it here instead
+       if ( this.surface ) {
+               this.surface.endRelocation();
+       }
        this.$relocatableMarker.removeClass( 
've-ce-focusableNode-highlight-relocating' );
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/139673
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I259fbfb0fe122c1bad7ea49fb7f5684821eca452
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to