Permalink
Browse files

Use object syntax to register handlers

  • Loading branch information...
Pl217 authored and Nikerabbit committed May 29, 2018
1 parent a08d832 commit e11d7951e315a1b5f2789a13ba77fdf7a250534f
Showing with 12 additions and 8 deletions.
  1. +8 −6 src/jquery.ime.js
  2. +4 −2 src/jquery.ime.selector.js
View
@@ -73,12 +73,14 @@
* Listen for events and bind to handlers
*/
listen: function () {
- this.$element.on( 'keypress.ime', this.keypress.bind( this ) );
- this.$element.on( 'keyup.ime', this.keyup.bind( this ) );
- this.$element.on( 'keydown.ime', this.keydown.bind( this ) );
- this.$element.on( 'destroy.ime', this.destroy.bind( this ) );
- this.$element.on( 'enable.ime', this.enable.bind( this ) );
- this.$element.on( 'disable.ime', this.disable.bind( this ) );
+ this.$element.on( {
+ 'keypress.ime': this.keypress.bind( this ),
+ 'keyup.ime': this.keyup.bind( this ),
+ 'keydown.ime': this.keydown.bind( this ),
+ 'destroy.ime': this.destroy.bind( this ),
+ 'enable.ime': this.enable.bind( this ),
+ 'disable.ime': this.disable.bind( this )
+ } );
},
/**
@@ -195,8 +195,10 @@
} );
// Possible resize of textarea
- imeselector.$element.on( 'mouseup.ime', this.position.bind( this ) );
- imeselector.$element.on( 'keydown.ime', this.keydown.bind( this ) );
+ imeselector.$element.on( {
+ 'mouseup.ime': this.position.bind( this ),
+ 'keydown.ime': this.keydown.bind( this )
+ } );
// Update IM selector position when the window is resized
// or the browser window is zoomed in or zoomed out

0 comments on commit e11d795

Please sign in to comment.