|
|
@@ -20,22 +20,24 @@ module.exports = {
|
|
|
? 'change'
|
|
|
: 'input'
|
|
|
|
|
|
- // determin the attribute to change when updating
|
|
|
+ // determine the attribute to change when updating
|
|
|
var attr = self.attr = type === 'checkbox'
|
|
|
? 'checked'
|
|
|
: (tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA')
|
|
|
? 'value'
|
|
|
: 'innerHTML'
|
|
|
|
|
|
- var compositionLock = false
|
|
|
- this.cLock = function () {
|
|
|
- compositionLock = true
|
|
|
- }
|
|
|
- this.cUnlock = function () {
|
|
|
- compositionLock = false
|
|
|
+ if (self.filters) {
|
|
|
+ var compositionLock = false
|
|
|
+ this.cLock = function () {
|
|
|
+ compositionLock = true
|
|
|
+ }
|
|
|
+ this.cUnlock = function () {
|
|
|
+ compositionLock = false
|
|
|
+ }
|
|
|
+ el.addEventListener('compositionstart', this.cLock)
|
|
|
+ el.addEventListener('compositionend', this.cUnlock)
|
|
|
}
|
|
|
- el.addEventListener('compositionstart', this.cLock)
|
|
|
- el.addEventListener('compositionend', this.cUnlock)
|
|
|
|
|
|
// attach listener
|
|
|
self.set = self.filters
|
|
|
@@ -118,8 +120,10 @@ module.exports = {
|
|
|
unbind: function () {
|
|
|
var el = this.el
|
|
|
el.removeEventListener(this.event, this.set)
|
|
|
- el.removeEventListener('compositionstart', this.cLock)
|
|
|
- el.removeEventListener('compositionend', this.cUnlock)
|
|
|
+ if (this.filters) {
|
|
|
+ el.removeEventListener('compositionstart', this.cLock)
|
|
|
+ el.removeEventListener('compositionend', this.cUnlock)
|
|
|
+ }
|
|
|
if (isIE9) {
|
|
|
el.removeEventListener('cut', this.onCut)
|
|
|
el.removeEventListener('keyup', this.onDel)
|