Преглед на файлове

Lungo.Router.Tablet history fix and some tests

piniphone преди 13 години
родител
ревизия
0c3bbf66d1
променени са 5 файла, в които са добавени 133 реда и са изтрити 4 реда
  1. 1 1
      example/others/tablet2.html
  2. 1 1
      example/others/tablet3.html
  3. 64 0
      example/others/tablet4.html
  4. 64 0
      example/others/tablet5.html
  5. 3 2
      src/modules/Lungo.Router.Tablet.coffee

+ 1 - 1
example/others/tablet2.html

@@ -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">

+ 1 - 1
example/others/tablet3.html

@@ -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">

+ 64 - 0
example/others/tablet4.html

@@ -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 - 0
example/others/tablet5.html

@@ -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>
+
+
+
+
+
+
+
+
+

+ 3 - 2
src/modules/Lungo.Router.Tablet.coffee

@@ -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.
@@ -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})"