https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112870

Revision: 112870
Author:   inez
Date:     2012-03-02 02:07:55 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
Improvements to changes polling mechanism

Modified Paths:
--------------
    trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js

Modified: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js
===================================================================
--- trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js        
2012-03-02 01:54:39 UTC (rev 112869)
+++ trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js        
2012-03-02 02:07:55 UTC (rev 112870)
@@ -50,7 +50,7 @@
                        _this.onPaste( e );
                } )
                .on( 'mousedown', function( e ) {
-                       // return _this.onMouseDown( e );
+                        return _this.onMouseDown( e );
                } )
                .on( 'compositionstart', function( e ) {
                        console.log('comp start');
@@ -275,7 +275,20 @@
        this.poll.prevOffset = localOffset;
 };
 
+ve.es.Surface.prototype.onMouseDown = function( e ) {
+       if ( this.poll.interval !== null ) {
+               this.stopPolling();
+               this.pollContent();
+               this.startPolling();
+       }
+};
+
 ve.es.Surface.prototype.onKeyDown = function( e ) {
+       if ( this.poll.interval !== null ) {
+               this.stopPolling();
+               this.pollContent();
+               this.startPolling();
+       }
        switch ( e.keyCode ) {
                // Enter
                case 13:
@@ -321,12 +334,10 @@
                        }
                        break;
        }
-       /*
        var range = this.getSelection();
        if ( range.getLength() !== 0 ) {
                e.preventDefault();
        }
-       */
 };
 
 ve.es.Surface.prototype.getOffset = function( elem, offset, global ) {


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

Reply via email to