From 44de8fe2d324ac0ba6693cb37eaddda24086377f Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Thu, 29 Aug 2013 15:33:48 -0700 Subject: [PATCH] Add getActivePaneItem method to Pane and PaneAxis --- src/pane-axis.coffee | 6 ++++++ src/pane.coffee | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/pane-axis.coffee b/src/pane-axis.coffee index a7abd8e5c..adb2b3657 100644 --- a/src/pane-axis.coffee +++ b/src/pane-axis.coffee @@ -69,6 +69,12 @@ class PaneAxis extends View getContainer: -> @closest('#panes').view() + getActivePaneItem: -> + @getActivePane()?.activeItem + + getActivePane: -> + @find('.pane.active').view() ? @find('.pane:first').view() + insertChildBefore: (child, newChild, options={}) -> newChild.insertBefore(child) if options.updateState ? true diff --git a/src/pane.coffee b/src/pane.coffee index 23a7cd8b4..afbdc5801 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -142,6 +142,9 @@ class Pane extends View else @showItemAtIndex(@items.length - 1) + getActivePaneItem: -> + @activeItem + # Public: Returns the index of the currently active item. getActiveItemIndex: -> @items.indexOf(@activeItem)