Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

patch turbolinks to enable fancybox pushState

  • Loading branch information...
commit 80c87bba0446516ade36df3bb46e4730a04b428c 1 parent 1eed8ce
@anthonyalberto anthonyalberto authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/assets/javascripts/turbolinks.js.coffee
View
6 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

@mbillard
Collaborator

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

@anthonyalberto

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.
Something went wrong with that request. Please try again.