Skip to content

Commit 303cacc

Browse files
author
Evan You
committed
only listen for composition event when has filters, use fork for vinyl-fs, update travis script
1 parent 398419f commit 303cacc

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ branches:
55
only:
66
- master
77
before_install:
8-
- npm install -g grunt-cli component
9-
- git clone git://github.com/n1k0/casperjs.git ~/casperjs
10-
- cd ~/casperjs
11-
- git checkout tags/1.1-beta1
12-
- export PATH=$PATH:`pwd`/bin
13-
- cd -
8+
- npm install -g grunt-cli component phantomjs casperjs
149
before_script:
1510
- component install

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"shell-task": "~0.1.1",
3333
"map-stream": "0.0.4",
3434
"uglify-js": "~2.4.8",
35-
"vinyl-fs": "git://github.com/wearefractal/vinyl-fs",
35+
"vinyl-fs": "git://github.com/yyx990803/vinyl-fs",
3636
"gulp-component": "~0.1.3"
3737
}
3838
}

src/directives/model.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@ module.exports = {
2020
? 'change'
2121
: 'input'
2222

23-
// determin the attribute to change when updating
23+
// determine the attribute to change when updating
2424
var attr = self.attr = type === 'checkbox'
2525
? 'checked'
2626
: (tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA')
2727
? 'value'
2828
: 'innerHTML'
2929

30-
var compositionLock = false
31-
this.cLock = function () {
32-
compositionLock = true
33-
}
34-
this.cUnlock = function () {
35-
compositionLock = false
30+
if (self.filters) {
31+
var compositionLock = false
32+
this.cLock = function () {
33+
compositionLock = true
34+
}
35+
this.cUnlock = function () {
36+
compositionLock = false
37+
}
38+
el.addEventListener('compositionstart', this.cLock)
39+
el.addEventListener('compositionend', this.cUnlock)
3640
}
37-
el.addEventListener('compositionstart', this.cLock)
38-
el.addEventListener('compositionend', this.cUnlock)
3941

4042
// attach listener
4143
self.set = self.filters
@@ -118,8 +120,10 @@ module.exports = {
118120
unbind: function () {
119121
var el = this.el
120122
el.removeEventListener(this.event, this.set)
121-
el.removeEventListener('compositionstart', this.cLock)
122-
el.removeEventListener('compositionend', this.cUnlock)
123+
if (this.filters) {
124+
el.removeEventListener('compositionstart', this.cLock)
125+
el.removeEventListener('compositionend', this.cUnlock)
126+
}
123127
if (isIE9) {
124128
el.removeEventListener('cut', this.onCut)
125129
el.removeEventListener('keyup', this.onDel)

0 commit comments

Comments
 (0)