beyond-rails 0.0.255 → 0.0.256
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/js/components/TagInput.js +11 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3e85d9b4c8f791f8ed1eb1bac8a68f71ca189301734451410d1da2628cf49e9
|
4
|
+
data.tar.gz: fb6e1b6de1b7703918a39e5f426bcfad2cc743fbb5c9534878e86ba3f635586d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7408a3297619f390240197b29e768e9a37ad7c3377072470edafdbc29762d8bbd3b146f14808417ea1f16258c79e0cf30d2b09f0581ff4f755beb2c20422a5b0
|
7
|
+
data.tar.gz: 90c1d93650ecdfa61be3ea6e4d37c8bbe81804748fb9233cb5bf48fbfa6fde4ff555f2a5ffcd2f9d5409c3dd0f142dd2a944fa2ddede8cb5780400bd75eaa029
|
@@ -82,15 +82,23 @@ export default class TagInput {
|
|
82
82
|
}
|
83
83
|
const { elem } = tag
|
84
84
|
const { timeout } = options
|
85
|
-
|
85
|
+
|
86
|
+
if (this.timer) {
|
87
|
+
clearTimeout(this.timer)
|
88
|
+
this.timer = null
|
89
|
+
}
|
90
|
+
else {
|
91
|
+
this.oldAttrs = rows.map(row => elem.getAttribute(row.name))
|
92
|
+
}
|
86
93
|
|
87
94
|
rows.forEach(row => {
|
88
95
|
elem.setAttribute(row.name, row.value)
|
89
96
|
})
|
90
97
|
|
91
98
|
if (timeout) {
|
92
|
-
setTimeout(() => {
|
99
|
+
this.timer = setTimeout(() => {
|
93
100
|
if (document.body.contains(elem)) {
|
101
|
+
const { oldAttrs } = this
|
94
102
|
rows.forEach((row, i) => {
|
95
103
|
elem.setAttribute(row.name, oldAttrs[i])
|
96
104
|
})
|
@@ -148,10 +156,9 @@ export default class TagInput {
|
|
148
156
|
if (! res.isTag) {
|
149
157
|
return this.shake()
|
150
158
|
}
|
151
|
-
this.addTag(inputValue, res)
|
152
|
-
|
153
159
|
input.value = ''
|
154
160
|
suggestInput.value = ''
|
161
|
+
this.addTag(inputValue, res)
|
155
162
|
}
|
156
163
|
|
157
164
|
removeTagIfNeeded() {
|