Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
Patch for issue #2 Shouldn't alter location.hash if no default target…
Browse files Browse the repository at this point in the history
… id set
  • Loading branch information
Trott committed May 31, 2012
1 parent b605f94 commit 7dcd038
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LightningTouch.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
} }
} }


if (!location.hash) { if ((!location.hash) && (defaultTargetId!=='')) {
location.hash = '#/' + defaultTargetId; location.hash = '#/' + defaultTargetId;
} }
showContent(location.hash.substring(2), [defaultTargetId]); showContent(location.hash.substring(2), [defaultTargetId]);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<title>Lightning Touch Demos</title> <title>Lightning Touch Demos</title>
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<script src="LightningTouch-1.0.1.min.js"></script> <script src="LightningTouch-1.0.2.min.js"></script>


<!-- <!--
Function for onclick() handling so it can be compared to Lightning Touch. Function for onclick() handling so it can be compared to Lightning Touch.
Expand Down Expand Up @@ -53,4 +53,4 @@ <h2>That was slow.</h2>
<a href="#" onclick="swap('onclick-main','less-awesome'); return false;">Tap to reset onclick listener.</a> <a href="#" onclick="swap('onclick-main','less-awesome'); return false;">Tap to reset onclick listener.</a>


</div> </div>
</section> </section>
9 changes: 9 additions & 0 deletions tests/no_default_hash.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<title>Lightning Touch Test</title>
<meta name="viewport" content="width=device-width">
<script src="../LightningTouch.js"></script>

<body>
<p>There should be no hash inserted in the URL on this page.</p>
</body>

0 comments on commit 7dcd038

Please sign in to comment.