Catrope has submitted this change and it was merged.

Change subject: Always fix up selection after ce.Surface#focus
......................................................................


Always fix up selection after ce.Surface#focus

Otherwise we get a broken selection in surface widgets. The bug which
this.focusing was introduced to fix has been fixed elsewhere.

Bug: 64399
Change-Id: Ie996812ccd6166f6cc348985271d720c9c484fa5
---
M modules/ve/ce/ve.ce.Surface.js
1 file changed, 1 insertion(+), 6 deletions(-)

Approvals:
  Catrope: Verified; Looks good to me, approved



diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index 6c250ee..fcdbae9 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -43,7 +43,6 @@
        this.clipboardId = String( Math.random() );
        this.renderLocks = 0;
        this.dragging = false;
-       this.focusing = false;
        this.relocating = false;
        this.selecting = false;
        this.resizing = false;
@@ -350,7 +349,6 @@
  * function will also reapply the selection, even if the surface is already 
focused.
  */
 ve.ce.Surface.prototype.focus = function () {
-       this.focusing = true;
        // Focus the documentNode for text selections, or the pasteTarget for 
focusedNode selections
        if ( this.focusedNode ) {
                this.$pasteTarget[0].focus();
@@ -360,9 +358,6 @@
                // but onDocumentFocus won't fire so restore the selection here 
too.
                this.onModelSelect( this.surface.getModel().getSelection() );
        }
-       setTimeout( ve.bind( function () {
-               this.focusing = false;
-       }, this ) );
        // onDocumentFocus takes care of the rest
 };
 
@@ -399,7 +394,7 @@
  * @fires focus
  */
 ve.ce.Surface.prototype.onDocumentFocus = function () {
-       if ( !this.dragging && !this.focusing ) {
+       if ( !this.dragging ) {
                // If the document is being focused by a non-mouse user event, 
FF may place
                // the cursor in a non-content offset (i.e. just after the 
document div), so
                // find the first content offset instead.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie996812ccd6166f6cc348985271d720c9c484fa5
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: wmf/1.24wmf2
Gerrit-Owner: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to