jenkins-bot has submitted this change and it was merged.

Change subject: Make link inspector not close itself in IE... again
......................................................................


Make link inspector not close itself in IE... again

My hacks for making the blur/focus code not notice that
the selection moved seem to be working (but only in VE-MW,
not in VE core), but now the SurfaceObserver's polling
is noticing that the range goes to null instead, and that's
causing inspectors to close themselves at the first poll.

To work around this, stop the observer when an inspector
is opened, and restart it once it's closed. There should
be nicer facilities for this in ce.Surface, but right now
we just want to fix a critical IE bug.

In the future, there should be more advanced logic here
with fake selections, so we can un-isolate inspectors.

Bug: 72392
Change-Id: I0a7c6aed37c1688eb81d4ca0c9ded231f9fd68f1
---
M src/ui/ve.ui.Context.js
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/ui/ve.ui.Context.js b/src/ui/ve.ui.Context.js
index 968e5da..eb8974b 100644
--- a/src/ui/ve.ui.Context.js
+++ b/src/ui/ve.ui.Context.js
@@ -123,7 +123,14 @@
  * @param {Object} data Window opening data
  */
 ve.ui.Context.prototype.onInspectorOpening = function ( win, opening ) {
+       var observer = this.surface.getView().surfaceObserver;
        this.inspector = win;
+
+       // Shut down the SurfaceObserver as soon as possible, so it doesn't get 
confused
+       // by the selection moving around in IE. Will be reenabled when 
inspector closes.
+       // FIXME this should be done in a nicer way, managed by the Surface 
classes
+       observer.pollOnce();
+       observer.stopTimerLoop();
 
        opening
                .progress( ve.bind( function ( data ) {
@@ -145,6 +152,9 @@
 
                                        this.inspector = null;
 
+                                       // Reenable observer
+                                       observer.startTimerLoop();
+
                                        if ( inspectable ) {
                                                // Change state: inspector -> 
menu
                                                this.menu.toggle( true );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a7c6aed37c1688eb81d4ca0c9ded231f9fd68f1
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: wmf/1.25wmf4
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to