File tree 1 file changed +6
-4
lines changed
src/directives/public/model 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -93,9 +93,10 @@ export default {
93
93
// jQuery variable in tests.
94
94
this . hasjQuery = typeof jQuery === 'function'
95
95
if ( this . hasjQuery ) {
96
- jQuery ( el ) . on ( 'change' , this . listener )
96
+ const method = jQuery . fn . on ? 'on' : 'bind'
97
+ jQuery ( el ) [ method ] ( 'change' , this . listener )
97
98
if ( ! lazy ) {
98
- jQuery ( el ) . on ( 'input' , this . listener )
99
+ jQuery ( el ) [ method ] ( 'input' , this . listener )
99
100
}
100
101
} else {
101
102
this . on ( 'change' , this . listener )
@@ -132,8 +133,9 @@ export default {
132
133
unbind ( ) {
133
134
var el = this . el
134
135
if ( this . hasjQuery ) {
135
- jQuery ( el ) . off ( 'change' , this . listener )
136
- jQuery ( el ) . off ( 'input' , this . listener )
136
+ const method = jQuery . fn . off ? 'off' : 'unbind'
137
+ jQuery ( el ) [ method ] ( 'change' , this . listener )
138
+ jQuery ( el ) [ method ] ( 'input' , this . listener )
137
139
}
138
140
}
139
141
}
You can’t perform that action at this time.
0 commit comments