Skip to content

Commit

Permalink
Lungo.Router.Tablet history fix and some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pinaypunto committed Aug 12, 2013
1 parent d669ead commit 0c3bbf6
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/others/tablet2.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Lungo Flexbox - SDK</title>
<title>Tablet2</title>
<meta name="description" content="">
<meta name="author" content="Javier Jiménez Villar (@soyjavi)">
<meta name="HandheldFriendly" content="True">
Expand Down
2 changes: 1 addition & 1 deletion example/others/tablet3.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Lungo Flexbox - SDK</title>
<title>Tablet3</title>
<meta name="description" content="">
<meta name="author" content="Javier Jiménez Villar (@soyjavi)">
<meta name="HandheldFriendly" content="True">
Expand Down
64 changes: 64 additions & 0 deletions example/others/tablet4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Tablet4</title>
<meta name="description" content="">
<meta name="author" content="Javier Jiménez Villar (@soyjavi)">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="cleartype" content="on">

<!-- Main Stylesheet -->
<link rel="stylesheet" href="../components/lungo.brownie/lungo.css">
<link rel="stylesheet" href="../components/lungo.brownie/lungo.theme.css">
<link rel="stylesheet" href="../components/lungo.icon/lungo.icon.css">
</head>

<body>

<section id="security" data-transition="slide">
<article>
security
<button data-view-section="main">Go main!</button>
</article>
</section>

<section id="main" data-transition="slide" data-children="other">
<article>
main
<button data-view-section="back">Go back!</button>
<button data-view-section="other">Go other!</button>
</article>
</section>

<section id="other" data-transition="slide">
<article>
other
<button data-view-section="back">Go back!</button>
</article>
</section>

<!-- Lungo dependencies -->
<script src="../components/quojs/quo.js"></script>
<script src="../components/lungo.brownie/lungo.debug.js"></script>
<script>
Lungo.init({
name: 'test',
history: false
});
</script>
</body>
</html>









64 changes: 64 additions & 0 deletions example/others/tablet5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Tablet5</title>
<meta name="description" content="">
<meta name="author" content="Javier Jiménez Villar (@soyjavi)">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="cleartype" content="on">

<!-- Main Stylesheet -->
<link rel="stylesheet" href="../components/lungo.brownie/lungo.css">
<link rel="stylesheet" href="../components/lungo.brownie/lungo.theme.css">
<link rel="stylesheet" href="../components/lungo.icon/lungo.icon.css">
</head>

<body>

<section id="security" data-transition="slide">
<article>
security
<button data-view-section="main">Go main!</button>
</article>
</section>

<section id="main" data-transition="slide">
<article>
main!!!
<button data-view-section="back">Go back!</button>
<button data-view-section="other">Go other!</button>
</article>
</section>

<section id="other" data-transition="slide">
<article>
other
<button data-view-section="back">Go back!</button>
</article>
</section>

<!-- Lungo dependencies -->
<script src="../components/quojs/quo.js"></script>
<script src="../components/lungo.brownie/lungo.debug.js"></script>
<script>
Lungo.init({
name: 'test',
history: false
});
</script>
</body>
</html>









5 changes: 3 additions & 2 deletions src/modules/Lungo.Router.Tablet.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ Lungo.RouterTablet = do (lng = Lungo) ->
@method step
@param {string} Id of the section
###
step = (section_id) -> _history.push section_id if section_id isnt history()
step = (section_id) ->
if section_id isnt history()
_history.push section_id

###
Returns the current browsing history section id.
Expand Down Expand Up @@ -144,7 +146,6 @@ Lungo.RouterTablet = do (lng = Lungo) ->
_showForward = (current, future) ->
if _isChild(current, future) then _applyDirection(future, "in")
else
do _removeLast
hideSelector = "section.#{C.CLASS.SHOW}"
parent_id = _parentId(future)
if parent_id then hideSelector += ":not(##{parent_id})"
Expand Down

0 comments on commit 0c3bbf6

Please sign in to comment.