From c2381e05e50d7e2fc55e671470207de7afce6dde Mon Sep 17 00:00:00 2001 From: simurai Date: Sat, 24 Oct 2015 17:50:40 +0900 Subject: [PATCH] Add top/bottom bar API --- src/workspace.coffee | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/workspace.coffee b/src/workspace.coffee index 7ee68e2f8..dbd056c72 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -838,6 +838,44 @@ class Workspace extends Model addTopPanel: (options) -> @addPanel('top', options) + # Essential: Get an {Array} of all the panel items at the top of the window. + getTopBarPanels: -> + @getPanels('topBar') + + # Essential: Adds a panel item to the top of the window. It will take up full width. + # + # * `options` {Object} + # * `item` Your panel content. It can be DOM element, a jQuery element, or + # a model with a view registered via {ViewRegistry::addViewProvider}. We recommend the + # latter. See {ViewRegistry::addViewProvider} for more information. + # * `visible` (optional) {Boolean} false if you want the panel to initially be hidden + # (default: true) + # * `priority` (optional) {Number} Determines stacking order. Lower priority items are + # forced closer to the edges of the window. (default: 100) + # + # Returns a {Panel} + addTopBarPanel: (options) -> + @addPanel('topBar', options) + + # Essential: Get an {Array} of all the panel items at the bottom of the window. + getBottomBarPanels: -> + @getPanels('bottomBar') + + # Essential: Adds a panel item to the bottom of the window. It will take up full width. + # + # * `options` {Object} + # * `item` Your panel content. It can be DOM element, a jQuery element, or + # a model with a view registered via {ViewRegistry::addViewProvider}. We recommend the + # latter. See {ViewRegistry::addViewProvider} for more information. + # * `visible` (optional) {Boolean} false if you want the panel to initially be hidden + # (default: true) + # * `priority` (optional) {Number} Determines stacking order. Lower priority items are + # forced closer to the edges of the window. (default: 100) + # + # Returns a {Panel} + addBottomBarPanel: (options) -> + @addPanel('bottomBar', options) + # Essential: Get an {Array} of all the modal panel items getModalPanels: -> @getPanels('modal')