Просмотр исходного кода

Merge branch 'master' of https://github.com/tapquo/Lungo.js

* 'master' of https://github.com/tapquo/Lungo.js:
  Fixed spelling (Gettins Started)
  Update navs fix opening async section from aside
  Tablet fixes
soyjavi 13 лет назад
Родитель
Сommit
e2fd209af2

+ 1 - 1
README.md

@@ -15,7 +15,7 @@ A HTML5 framework for developers who want to design, build and share cross devic
 
 
 
 
 
 
-Gettins Started
+Getting Started
 ---------------
 ---------------
 The idea of Lungo arose in year 2010 when the craftman Javi Jiménez Villar ([**soyjavi**](https://twitter.com/soyjavi)) saw that hot existing Mobile Frameworks at that time were not powerful and not using the features of HTML5.
 The idea of Lungo arose in year 2010 when the craftman Javi Jiménez Villar ([**soyjavi**](https://twitter.com/soyjavi)) saw that hot existing Mobile Frameworks at that time were not powerful and not using the features of HTML5.
 
 

+ 1 - 1
src/modules/Lungo.Aside.coffee

@@ -34,7 +34,7 @@ Lungo.Aside = do (lng = Lungo) ->
             childs = aside_section.data("children").split(" ")
             childs = aside_section.data("children").split(" ")
             for child in childs
             for child in childs
               child = lng.dom(C.ELEMENT.SECTION + "#" + child)
               child = lng.dom(C.ELEMENT.SECTION + "#" + child)
-              if child.hasClass(C.CLASS.SHOW) then child.addClass "shadowing"
+              if child.length and child.hasClass(C.CLASS.SHOW) then child.addClass "shadowing"
 
 
           aside_section.removeClass("aside").addClass "asideShowing"
           aside_section.removeClass("aside").addClass "asideShowing"
 
 

+ 4 - 3
src/modules/Lungo.Router.Phone.coffee

@@ -32,7 +32,6 @@ Lungo.RouterPhone = do (lng = Lungo) ->
         _section future, current
         _section future, current
         lng.Router.step section_id
         lng.Router.step section_id
         do _url unless Lungo.Config.history is false
         do _url unless Lungo.Config.history is false
-        do _updateNavigationElements
     else if lng.Element.Cache.aside then do lng.Aside.hide
     else if lng.Element.Cache.aside then do lng.Aside.hide
 
 
   ###
   ###
@@ -103,13 +102,15 @@ Lungo.RouterPhone = do (lng = Lungo) ->
   Private methods
   Private methods
   ###
   ###
   _section = (future, current, backward = false) ->
   _section = (future, current, backward = false) ->
-    callback = -> _show future, current, backward
+    callback = ->
+      _show future, current, backward
+      do _updateNavigationElements
     if lng.Element.Cache.aside then lng.Aside.hide callback
     if lng.Element.Cache.aside then lng.Aside.hide callback
     else do callback
     else do callback
 
 
   _show = (future, current, backward) ->
   _show = (future, current, backward) ->
-    if current? then _setSectionDirections future, current, backward
     lng.Section.show current, future
     lng.Section.show current, future
+    if current? then _setSectionDirections future, current, backward
 
 
   _setSectionDirections = (future, current, backward=false) ->
   _setSectionDirections = (future, current, backward=false) ->
     if not current? or not future.length then return false
     if not current? or not future.length then return false

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

@@ -198,13 +198,23 @@ Lungo.RouterTablet = do (lng = Lungo) ->
       unless section.hasClass(C.CLASS.SHOW) then apply = true
       unless section.hasClass(C.CLASS.SHOW) then apply = true
     else apply = true
     else apply = true
     if apply
     if apply
-      section.addClass(C.CLASS.SHOW)
-      section.data(C.ATTRIBUTE.DIRECTION, direction) if section.data(C.TRANSITION.ATTR)
+      if isForward
+        section.addClass(C.CLASS.HIDE)
+        section.addClass(C.CLASS.SHOW)
+        setTimeout (->
+          section.data(C.ATTRIBUTE.DIRECTION, direction).removeClass(C.CLASS.HIDE)
+        ), 10
+      else
+        section.addClass(C.CLASS.SHOW)
+        section.data(C.ATTRIBUTE.DIRECTION, direction)
+
 
 
   _sameSection = ->
   _sameSection = ->
     if not event or not lng.Element.Cache.section then return true
     if not event or not lng.Element.Cache.section then return true
     dispacher_section = lng.dom(event.target).closest("section,aside")
     dispacher_section = lng.dom(event.target).closest("section,aside")
-    same = dispacher_section.attr("id") is lng.Element.Cache.section.attr("id")
+    if dispacher_section.length
+      same = dispacher_section.attr("id") is lng.Element.Cache.section.attr("id")
+    else same = true
     return same
     return same
 
 
   _notCurrentTarget = (current, id) -> current?.attr(C.ATTRIBUTE.ID) isnt id
   _notCurrentTarget = (current, id) -> current?.attr(C.ATTRIBUTE.ID) isnt id

+ 6 - 0
src/stylesheets/lungo.media.tablet.styl

@@ -10,6 +10,9 @@
     vendor(perspective, 800px)
     vendor(perspective, 800px)
     vendor(transform-style, preserve-3d)
     vendor(transform-style, preserve-3d)
 
 
+    & div.notification
+      position: absolute !important
+
     & > section, & > aside
     & > section, & > aside
       backface-visibility hidden
       backface-visibility hidden
       vendor(animation-timing-function, DEFAULT_TRANSITION)
       vendor(animation-timing-function, DEFAULT_TRANSITION)
@@ -59,6 +62,9 @@
         transform translateX(ASIDE_WIDTH)
         transform translateX(ASIDE_WIDTH)
         opacity: .6
         opacity: .6
 
 
+      &.hide, &.hide *
+        opacity: 0
+
       &:not([data-children])
       &:not([data-children])
         box-flex(1)
         box-flex(1)
 
 

+ 1 - 1
src/stylesheets/lungo.widget.pull.styl

@@ -5,7 +5,7 @@ section.show > [data-control="pull"]
   position: absolute
   position: absolute
   z-index: -1
   z-index: -1
   top: HEADER_HEIGHT
   top: HEADER_HEIGHT
-  width: 100%
+  width: inherit
   height: 80px
   height: 80px
   padding: 10px 0
   padding: 10px 0
   text-align: center
   text-align: center