Permalink
Browse files

Support for count in showPrevious

nav.showPrevious(count: 2)
  • Loading branch information...
koenbok committed Nov 30, 2016
1 parent 13e72ba commit a65ffb226f5d4a5333efc62f0decb9fb2f8dd5ed
Showing with 12 additions and 4 deletions.
  1. +6 −3 extras/Studio.framer/app.coffee
  2. +6 −1 framer/Components/NavComponent.coffee
@@ -9,17 +9,20 @@ class Card extends Layer
c1 = new Card()
c2 = new Card()
c3 = new Card(size: 400)
c3 = new Card()
nav = new NavComponent(c1)
nav.header = new Layer
height: 80
width: Screen.width
nav.header.onClick -> nav.showPrevious()
nav.header.onClick ->
nav.showPrevious(animate: false)
Utils.labelLayer(nav.header, "Header")
c1.onClick -> nav.showNext(c2)
c2.onClick -> nav.showOverlayCenter(c3)
c2.onClick -> nav.showNext(c3)
c3.onTap -> nav.showPrevious(count: 2)
@@ -173,7 +173,12 @@ class exports.NavComponent extends Layer
showPrevious: (options={}) =>
return unless @previous
return if @isTransitioning
options = _.defaults({}, options, {animate: true})
options = _.defaults({}, options, {count: 1, animate: true})
if options.count > 1
count = options.count
@showPrevious(animate: false, count: 1) for n in [2..count]
previous = @_stack.pop()
@_runTransition(previous?.transition, "back", options.animate, @current, previous.layer)

0 comments on commit a65ffb2

Please sign in to comment.