|
@@ -18,12 +18,14 @@ Lungo.Router = do (lng = Lungo) ->
|
|
|
_inPage = undefined
|
|
_inPage = undefined
|
|
|
_animating = false
|
|
_animating = false
|
|
|
|
|
|
|
|
|
|
+
|
|
|
###
|
|
###
|
|
|
Navigate to a <section>.
|
|
Navigate to a <section>.
|
|
|
@method section
|
|
@method section
|
|
|
@param {string} Id of the <section>
|
|
@param {string} Id of the <section>
|
|
|
###
|
|
###
|
|
|
section = (section_id) ->
|
|
section = (section_id) ->
|
|
|
|
|
+ if _animating then return
|
|
|
_outPage = lng.Element.Cache.section
|
|
_outPage = lng.Element.Cache.section
|
|
|
if _notCurrentTarget(_outPage, section_id)
|
|
if _notCurrentTarget(_outPage, section_id)
|
|
|
query = C.ELEMENT.SECTION + HASHTAG + section_id
|
|
query = C.ELEMENT.SECTION + HASHTAG + section_id
|
|
@@ -47,6 +49,7 @@ Lungo.Router = do (lng = Lungo) ->
|
|
|
@method back
|
|
@method back
|
|
|
###
|
|
###
|
|
|
back = ->
|
|
back = ->
|
|
|
|
|
+ if _animating then return
|
|
|
do _removeLast
|
|
do _removeLast
|
|
|
_outPage = lng.Element.Cache.section
|
|
_outPage = lng.Element.Cache.section
|
|
|
query = C.ELEMENT.SECTION + HASHTAG + history()
|
|
query = C.ELEMENT.SECTION + HASHTAG + history()
|
|
@@ -122,8 +125,8 @@ Lungo.Router = do (lng = Lungo) ->
|
|
|
_removeLast = -> _history.length -= 1
|
|
_removeLast = -> _history.length -= 1
|
|
|
|
|
|
|
|
_bindAnimationEnd = ->
|
|
_bindAnimationEnd = ->
|
|
|
- document.addEventListener(ev, _transitionEnd) for ev in ANIMATIONEND_EVENTS
|
|
|
|
|
_animating = true
|
|
_animating = true
|
|
|
|
|
+ document.addEventListener(ev, _transitionEnd) for ev in ANIMATIONEND_EVENTS
|
|
|
|
|
|
|
|
_unbindAnimationEnd = ->
|
|
_unbindAnimationEnd = ->
|
|
|
document.removeEventListener(ev, _transitionEnd) for ev in ANIMATIONEND_EVENTS
|
|
document.removeEventListener(ev, _transitionEnd) for ev in ANIMATIONEND_EVENTS
|