twine-rails 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/assets/javascripts/twine.coffee +17 -9
- data/lib/twine-rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f8b1f18347a673c2da36ccab84449031136b661d8184beb2cad56ea81e471a87
|
4
|
+
data.tar.gz: e64ca56b6851cb8f7dc692e31812d0745b2ccb9a7f7594f254ff6f1c1b339717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23a2c7c69017ab0f289549aae0cd53d40ee09dfc04b956db63f4d9c4e5f26e0a20b9a56d996764b4e0b8a1b153d44fa8d1e44d52a6be82551dc82f61f293a34c
|
7
|
+
data.tar.gz: 5055a680b4b0a996b3c52c0f38a062e28427ff31a018c75a4d34ec49e846a8b58ccd3eeaa9052a6bea18fd5dab6d2d60b0ecf41f5e84365c42a3e4ae149c05b5
|
@@ -110,12 +110,9 @@
|
|
110
110
|
|
111
111
|
callbacks = currentBindingCallbacks
|
112
112
|
|
113
|
-
# IE and Safari don't support node.children for DocumentFragment
|
114
|
-
#
|
115
|
-
|
116
|
-
# https://developer.mozilla.org/en-US/docs/Web/API/ParentNode.children
|
117
|
-
# As a result, Twine are unsupported within DocumentFragment and SVGElement nodes.
|
118
|
-
bind(context, childNode, if newContextKey? then null else indexes) for childNode in (node.children || [])
|
113
|
+
# IE and Safari don't support node.children for DocumentFragment or SVGElement,
|
114
|
+
# See explanation in childrenForNode()
|
115
|
+
bind(context, childNode, if newContextKey? then null else indexes) for childNode in childrenForNode(node)
|
119
116
|
Twine.count = nodeCount
|
120
117
|
|
121
118
|
for callback in callbacks || []
|
@@ -124,6 +121,18 @@
|
|
124
121
|
|
125
122
|
Twine
|
126
123
|
|
124
|
+
# IE and Safari don't support node.children for DocumentFragment and SVGElement nodes.
|
125
|
+
# If the element supports children we continue to traverse the children, otherwise
|
126
|
+
# we stop traversing that subtree.
|
127
|
+
# https://developer.mozilla.org/en-US/docs/Web/API/ParentNode.children
|
128
|
+
# As a result, Twine are unsupported within DocumentFragment and SVGElement nodes.
|
129
|
+
#
|
130
|
+
# We also prevent nodes from being iterated over more than once by cacheing the
|
131
|
+
# lookup for children nodes, which prevents nodes that are dynamically inserted
|
132
|
+
# or removed as siblings from causing double/ missed binds and unbinds.
|
133
|
+
childrenForNode = (node) ->
|
134
|
+
if node.children then Array::slice.call(node.children, 0) else []
|
135
|
+
|
127
136
|
findOrCreateElementForNode = (node) ->
|
128
137
|
node.bindingId ?= ++nodeCount
|
129
138
|
elements[node.bindingId] ?= {}
|
@@ -169,10 +178,9 @@
|
|
169
178
|
delete elements[id]
|
170
179
|
delete node.bindingId
|
171
180
|
|
172
|
-
|
173
181
|
# IE and Safari don't support node.children for DocumentFragment or SVGElement,
|
174
|
-
# See
|
175
|
-
Twine.unbind(childNode) for childNode in (node
|
182
|
+
# See explanation in childrenForNode()
|
183
|
+
Twine.unbind(childNode) for childNode in childrenForNode(node)
|
176
184
|
this
|
177
185
|
|
178
186
|
# Returns the binding context for a node by looking up the tree.
|
data/lib/twine-rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Li
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coffee-rails
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.6
|
103
|
+
rubygems_version: 2.7.6
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Minimalistic two-way bindings
|