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

Revision: 114036
Author:   inez
Date:     2012-03-16 22:01:09 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
Use on and off insteaf of bind and unbind.

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

Modified: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js
===================================================================
--- trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js        
2012-03-16 22:00:42 UTC (rev 114035)
+++ trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js        
2012-03-16 22:01:09 UTC (rev 114036)
@@ -46,12 +46,12 @@
        } );
 
        // Events
-       this.documentView.$.bind( {
+       this.documentView.$.on( {
                'focus': function( e ) {
                        _this.surfaceObserver.updateCursor( true );
                        _this.documentOnFocus();
-                       $document.unbind( '.ce-surfaceView' );
-                       $document.bind( {
+                       $document.off( '.ce-surfaceView' );
+                       $document.on( {
                                'keydown.ce-surfaceView': function( e ) {
                                        _this.surfaceObserver.updateCursor( 
true );
                                        return _this.onKeyDown( e );
@@ -64,32 +64,31 @@
                'blur': function( e ) {
                        _this.surfaceObserver.updateCursor( true );
                        _this.documentOnBlur();
-                       $document.unbind( '.ce-surfaceView' );
+                       $document.on( '.ce-surfaceView' );
                }
        } );
 
-       this.$
-               .on( 'cut copy', function( e ) {
+       this.$.on( {
+               'cut copy': function( e ) {
                        _this.onCutCopy( e );
-               } )
-               .on( 'paste', function( e ) {
+               },
+               'paste': function( e ) {
                        _this.onPaste( e );
-               } )
-               .on( 'mousedown', function( e ) {
+               },
+               'mousedown': function( e ) {
                        _this.surfaceObserver.updateCursor( true );
                        return _this.onMouseDown( e );
-               } )
-               .on( 'compositionstart', function( e ) {
-                       console.log('comp start');
+               },
+               'compositionstart': function( e ) {
                        _this.onCompositionStart( e );
-               } )
-               .on( 'compositionend', function( e ) {
-                       console.log('comp end');
+               },
+               'compositionend': function( e ) {
                        _this.onCompositionEnd( e );
-               } )
-               .on('dragover drop', function( e ) {
+               },
+               'dragover drop': function( e ) {
                        e.preventDefault();
-               } );
+               }
+       } );
 
        // Initialization
        this.documentView.renderContent();


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

Reply via email to