Permalink
Browse files

patch turbolinks to enable fancybox pushState

  • Loading branch information...
1 parent 1eed8ce commit 80c87bba0446516ade36df3bb46e4730a04b428c @anthonyalberto anthonyalberto committed Dec 5, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/assets/javascripts/turbolinks.js.coffee
@@ -261,8 +261,10 @@ initializeTurbolinks = ->
if state?.turbolinks
if pageCache[state.position]
fetchHistory state.position
- else
+ else if !meta || meta.lastPopstate != "fancybox"
visit event.target.location.href
+ else
+ meta.lastPushState = ""
, false
browserSupportsPushState =
@@ -287,6 +289,6 @@ else
# Public API
# Turbolinks.visit(url)
-# Turbolinks.pagesCached()
+# Turbolinks.pagesCached()
# Turbolinks.pagesCached(20)
@Turbolinks = { visit, pagesCached }

2 comments on commit 80c87bb

Maybe this could be more generic? Something like lastPopstate != "modal"?

Wow just noticed it says lastPushState instead of lastPopState in the else, will fix that. Yeah I'll replace for modal

Please sign in to comment.