angular-turbolinks 0.0.2 → 0.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd6b8ef2020d02124d74472c5919f16e5a033c58
|
4
|
+
data.tar.gz: 5b855413d3f56d8ddd16f64785a9b8817f366ba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b3cda9c629dab4d3b25b8f04ea2105f18205492a3fb3c82b23ac1a20ed31c0a02c183f114fa87f7b7c8d848947ae30f4ff97500e659ba59b759aeffa52d3727
|
7
|
+
data.tar.gz: 7b383624a784b779116cccfe5bc24133185ace2c25f3b68d042ddadc44c71d282567765ea4e5ecff719228f705156c85311a867612fe331a129fbbc932d27de0
|
@@ -125,6 +125,7 @@ angular.module('ngTurbolinks', []).run(($location, $rootScope, $http, $q)->
|
|
125
125
|
xhr_req.resolve() if xhr_req
|
126
126
|
xhr_req = $q.defer()
|
127
127
|
|
128
|
+
triggerEvent 'page:fetch', url: url
|
128
129
|
$http.get(url, {
|
129
130
|
headers: {
|
130
131
|
'Accept' : 'text/html, application/xhtml+xml, application/xml'
|
@@ -132,6 +133,7 @@ angular.module('ngTurbolinks', []).run(($location, $rootScope, $http, $q)->
|
|
132
133
|
},
|
133
134
|
timeout: xhr_req.promise
|
134
135
|
}).success((data, status, headers)->
|
136
|
+
triggerEvent 'page:receive'
|
135
137
|
if doc = processResponse(data, status, headers)
|
136
138
|
changePage extractTitleAndBody(doc)...
|
137
139
|
#reflectRedirectedUrl()
|
@@ -184,10 +186,10 @@ angular.module('ngTurbolinks', []).run(($location, $rootScope, $http, $q)->
|
|
184
186
|
document.location.href = url
|
185
187
|
|
186
188
|
$rootScope.$on("$locationChangeStart", (event, url, prev_url)->
|
187
|
-
if url == prev_url
|
189
|
+
if url == prev_url || !triggerEvent 'page:before-change'
|
188
190
|
event.preventDefault()
|
189
191
|
return false
|
190
|
-
|
192
|
+
|
191
193
|
visit(url)
|
192
194
|
)
|
193
195
|
)
|