lib/assets/javascripts/angular-turbolinks.js.coffee in angular-turbolinks-0.0.2 vs lib/assets/javascripts/angular-turbolinks.js.coffee in angular-turbolinks-0.0.3

- old
+ new

@@ -123,17 +123,19 @@ rememberReferer() xhr_req.resolve() if xhr_req xhr_req = $q.defer() + triggerEvent 'page:fetch', url: url $http.get(url, { headers: { 'Accept' : 'text/html, application/xhtml+xml, application/xml' 'X-XHR-Referer' : referer }, timeout: xhr_req.promise }).success((data, status, headers)-> + triggerEvent 'page:receive' if doc = processResponse(data, status, headers) changePage extractTitleAndBody(doc)... #reflectRedirectedUrl() triggerEvent 'page:load' else @@ -182,12 +184,12 @@ else visit = (url) -> document.location.href = url $rootScope.$on("$locationChangeStart", (event, url, prev_url)-> - if url == prev_url + if url == prev_url || !triggerEvent 'page:before-change' event.preventDefault() return false - + visit(url) ) )