angular-turbolinks 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbdaa5c3d6a148c572de57f963a036141a813811
4
- data.tar.gz: 500116fb34fb5ab8412c18353ec3aa6846d5b18f
3
+ metadata.gz: cd6b8ef2020d02124d74472c5919f16e5a033c58
4
+ data.tar.gz: 5b855413d3f56d8ddd16f64785a9b8817f366ba5
5
5
  SHA512:
6
- metadata.gz: 2fa345e94bc048d3befa159acbb44ff94bb37804260328c963206d9ccd687edca4e04e4e020216bc2310778ccacc369d9d8179d5ba796b5b430624a8c13d3107
7
- data.tar.gz: ff07075df0b113501c7fa2629ccad848acd94dc527a5836fad104f58e8761f3a0be42fd922870458d0d74d6339c5044a87343b5f33102e4806fbd8a99561cac6
6
+ metadata.gz: 1b3cda9c629dab4d3b25b8f04ea2105f18205492a3fb3c82b23ac1a20ed31c0a02c183f114fa87f7b7c8d848947ae30f4ff97500e659ba59b759aeffa52d3727
7
+ data.tar.gz: 7b383624a784b779116cccfe5bc24133185ace2c25f3b68d042ddadc44c71d282567765ea4e5ecff719228f705156c85311a867612fe331a129fbbc932d27de0
@@ -1,5 +1,5 @@
1
1
  module Angular
2
2
  module Turbolinks
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular-turbolinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cary Dunn