turbograft 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/turbograft/turbolinks.coffee +18 -19
- data/lib/turbograft/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d6ed5cfa12fb229dbe15a95c663d588fb286968
|
4
|
+
data.tar.gz: eb7db0db4ab8e83d2b99c84a734afd249abf976e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 139ff3da9750ac52978ab7de428a2da45ff9b506c0a5c42d29a33dfdbd9aafa07535cbf88870ebea0df5309c3d56493f34b45f6bf016cd19f139caa017ea00aa
|
7
|
+
data.tar.gz: 63a0480ab0ab39cb02133ab41692745f0ae15a30b742e0869543b28c9094e54bb393a16dd1b7986f92abf45746f7f3950c3e16a8dffe6d52c0115d7f31f3ee08
|
@@ -119,12 +119,11 @@ class window.Turbolinks
|
|
119
119
|
changePage = (title, body, csrfToken, runScripts, partialReplace, onlyKeys = [], exceptKeys = []) ->
|
120
120
|
document.title = title if title
|
121
121
|
|
122
|
-
refreshedNodes = []
|
123
|
-
refreshedNodes = refreshRefreshAlwaysNodes(body)
|
124
122
|
if onlyKeys.length
|
125
|
-
|
126
|
-
return
|
123
|
+
nodesToRefresh = [].concat(getNodesWithRefreshAlways(), getNodesMatchingRefreshKeys(onlyKeys))
|
124
|
+
return refreshNodes(nodesToRefresh, body)
|
127
125
|
else
|
126
|
+
refreshNodes(getNodesWithRefreshAlways(), body)
|
128
127
|
persistStaticElements(body)
|
129
128
|
if exceptKeys.length
|
130
129
|
refreshAllExceptWithKeys(exceptKeys, body)
|
@@ -141,6 +140,21 @@ class window.Turbolinks
|
|
141
140
|
|
142
141
|
return
|
143
142
|
|
143
|
+
getNodesMatchingRefreshKeys = (keys) ->
|
144
|
+
matchingNodes = []
|
145
|
+
for key in keys
|
146
|
+
for node in document.querySelectorAll("[refresh=#{key}]")
|
147
|
+
matchingNodes.push(node)
|
148
|
+
|
149
|
+
return matchingNodes
|
150
|
+
|
151
|
+
getNodesWithRefreshAlways = ->
|
152
|
+
matchingNodes = []
|
153
|
+
for node in document.querySelectorAll("[refresh-always]")
|
154
|
+
matchingNodes.push(node)
|
155
|
+
|
156
|
+
return matchingNodes
|
157
|
+
|
144
158
|
deleteRefreshNeverNodes = (body) ->
|
145
159
|
for node in body.querySelectorAll('[refresh-never]')
|
146
160
|
node.parentNode.removeChild(node)
|
@@ -176,21 +190,6 @@ class window.Turbolinks
|
|
176
190
|
|
177
191
|
refreshedNodes
|
178
192
|
|
179
|
-
refreshRefreshAlwaysNodes = (body) ->
|
180
|
-
allNodesToBeRefreshed = []
|
181
|
-
for node in document.querySelectorAll("[refresh-always]")
|
182
|
-
allNodesToBeRefreshed.push(node)
|
183
|
-
|
184
|
-
return refreshNodes(allNodesToBeRefreshed, body)
|
185
|
-
|
186
|
-
refreshNodesWithKeys = (keys, body) ->
|
187
|
-
allNodesToBeRefreshed = []
|
188
|
-
for key in keys
|
189
|
-
for node in document.querySelectorAll("[refresh=#{key}]")
|
190
|
-
allNodesToBeRefreshed.push(node)
|
191
|
-
|
192
|
-
return refreshNodes(allNodesToBeRefreshed, body)
|
193
|
-
|
194
193
|
keepNodes = (body, allNodesToKeep) ->
|
195
194
|
for existingNode in allNodesToKeep
|
196
195
|
unless nodeId = existingNode.getAttribute('id')
|
data/lib/turbograft/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbograft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristian Plettenberg-Dussault
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2015-01-
|
16
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: coffee-rails
|