Permalink
Browse files

use element's "input" event (HTML5) as well as "change"

  • Loading branch information...
1 parent bdd3b73 commit 0b2eef74c78c6483bb0f251b62ec98dbd87d0628 @kcivey kcivey committed Jul 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 Backbone.ModelBinder.js
@@ -173,14 +173,14 @@
},
_bindViewToModel:function () {
- $(this._rootEl).delegate('', 'change', this._onElChanged);
+ $(this._rootEl).delegate('', 'change input', this._onElChanged);
// The change event doesn't work properly for contenteditable elements - but blur does
$(this._rootEl).delegate('[contenteditable]', 'blur', this._onElChanged);
},
_unbindViewToModel: function(){
if(this._rootEl){
- $(this._rootEl).undelegate('', 'change', this._onElChanged);
+ $(this._rootEl).undelegate('', 'change input', this._onElChanged);
$(this._rootEl).undelegate('[contenteditable]', 'blur', this._onElChanged);
}
},

0 comments on commit 0b2eef7

Please sign in to comment.