Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Commit

Permalink
Don't remove noscript from body on page change
Browse files Browse the repository at this point in the history
  • Loading branch information
rhardih committed May 9, 2015
1 parent 09e47f4 commit 86518e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Turbolinks (master)

* Noscript tags are no longer removed from body on page changes.

*René Hansen*

* Deprecated `redirect_via_turbolinks_to` in favor of `redirect_to url, turbolinks: true`.

*Thibaut Courouble*
Expand Down
6 changes: 1 addition & 5 deletions lib/assets/javascripts/turbolinks.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ executeScriptTags = (selector) ->
parentNode.insertBefore copy, nextSibling
return

removeNoscriptTags = (node) ->
node.innerHTML = node.innerHTML.replace /<noscript[\S\s]*?<\/noscript>/ig, ''
node

# Firefox bug: Doesn't autofocus fields that are inserted via JavaScript
setAutofocusElement = ->
autofocusElement = (list = document.querySelectorAll 'input[autofocus], textarea[autofocus]')[list.length - 1]
Expand Down Expand Up @@ -308,7 +304,7 @@ processResponse = ->

extractTitleAndBody = (doc) ->
title = doc.querySelector 'title'
[ title?.textContent, removeNoscriptTags(doc.querySelector('body')), CSRFToken.get(doc).token ]
[ title?.textContent, doc.querySelector('body'), CSRFToken.get(doc).token ]

CSRFToken =
get: (doc = document) ->
Expand Down

0 comments on commit 86518e1

Please sign in to comment.