forked from bensochar/Web-2.0-Touch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated animate function to check if script tag type === 'text/javasc…
…ript' so templates stored in script tags as 'text/template' are not reloaded as scripts
- Loading branch information
1 parent
7c466b8
commit 721de11
Showing
1 changed file
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
* for touch devices (iPhone, iPad, iPod Touch, Android, etc.) | ||
* -- License - Dual licenses MIT and GPL | ||
* -- Developer - [email protected] | ||
* | ||
* -- UPDATES: | ||
* 2012-09-01 toddwprice ~line 396: updated animate function to check if script tag type === "text/javascript" so templates stored in script tags as "text/template" aren't reloaded as scripts | ||
*/ | ||
|
||
var jsTouch = { | ||
|
@@ -388,12 +391,16 @@ function jsTouchBox(name, params) { | |
// execute scripts | ||
var d = div_new.getElementsByTagName("script"); | ||
var t = d.length; | ||
for (var x = 0; x < t; x++) { | ||
var ns = document.createElement('script'); | ||
ns.type = "text/javascript"; | ||
if (d[x].text != '') ns.text = d[x].text; | ||
if (d[x].src != '') ns.src = d[x].src; | ||
div_new.appendChild(ns); | ||
for (var x = 0; x < t; x++) | ||
{ | ||
if (d[x].type === "text/javascript") | ||
{ | ||
var ns = document.createElement('script'); | ||
ns.type = "text/javascript"; | ||
if (d[x].text != '') ns.text = d[x].text; | ||
if (d[x].src != '') ns.src = d[x].src; | ||
div_new.appendChild(ns); | ||
} | ||
} | ||
// ------- | ||
this.resize(); | ||
|
@@ -496,4 +503,4 @@ function jsTouchBox(name, params) { | |
|
||
// -- few events | ||
window.addEventListener('resize', new Function("setTimeout(\"jsTouch.resize()\", 1)")); | ||
window.applicationCache.addEventListener('updateready', function(){ window.applicationCache.swapCache(); }, false); | ||
window.applicationCache.addEventListener('updateready', function () { window.applicationCache.swapCache(); window.location.reload(); }, false); |