// duration: Integer
// Amount of time (in ms) it takes to slide panes
duration: dijit.defaultDuration,
// _verticalSpace: Number
// Pixels of space available for the open pane
// (my content box size minus the cumulative size of all the title bars)
_verticalSpace: 0,
baseClass: "dijitAccordionContainer",
postCreate: function(){
this.domNode.style.overflow = "hidden";
this.inherited(arguments);
dijit.setWaiRole(this.domNode, "tablist");
},
startup: function(){
if(this._started){ return; }
this.inherited(arguments);
if(this.selectedChildWidget){
var style = this.selectedChildWidget.containerNode.style;
style.display = "";
style.overflow = "auto";
this.selectedChildWidget._buttonWidget._setSelectedState(true);
}
},
_getTargetHeight: function(/* Node */ node){
// summary:
// For the given node, returns the height that should be
// set to achieve our vertical space (subtract any padding
// we may have).
//
// This is used by the animations.
//
// TODO: I don't think this works correctly in IE quirks when an elements
// style.height including padding and borders
var cs = dojo.getComputedStyle(node);
return Math.max(this._verticalSpace - dojo._getPadBorderExtents(node, cs).h, 0);
},
layout: function(){
// Implement _LayoutWidget.layout() virtual method.
// Set the height of the open pane based on what room remains.
var openPane = this.selectedChildWidget;
// get cumulative height of all the title bars
var totalCollapsedHeight = 0;
dojo.forEach(this.getChildren(), function(child){
totalCollapsedHeight += child._buttonWidget.getTitleHeight();
});
var mySize = this._contentBox;
this._verticalSpace = mySize.h - totalCollapsedHeight;
// Memo size to make displayed child
this._containerContentBox = {
h: this._verticalSpace,
w: mySize.w
};
if(openPane){
openPane.resize(this._containerContentBox);
}
},
_setupChild: function(child){
// Overrides _LayoutWidget._setupChild().
// Setup clickable title to sit above the child widget,
// and stash pointer to it inside the widget itself.
child._buttonWidget = new dijit.layout._AccordionButton({
contentWidget: child,
title: child.title,
id: child.id + "_button",
parent: this
});
dojo.place(child._buttonWidget.domNode, child.domNode, "before");
this.inherited(arguments);
},
removeChild: function(child){
// Overrides _LayoutWidget.removeChild().
child._buttonWidget.destroy();
this.inherited(arguments);
},
getChildren: function(){
// Overrides _Container.getChildren() to ignore titles and only look at panes.
return dojo.filter(this.inherited(arguments), function(child){
return child.declaredClass != "dijit.layout._AccordionButton";
});";s:7:"summary";s:0:"";}s:39:"dijit.layout.AccordionContainer.destroy";a:4:{s:9:"prototype";s:31:"dijit.layout.AccordionContainer";s:4:"type";s:8:"Function";s:6:"source";s:124:" dojo.forEach(this.getChildren(), function(child){
child._buttonWidget.destroy();
});
this.inherited(arguments);";s:7:"summary";s:0:"";}s:43:"dijit.layout.AccordionContainer._transition";a:6:{s:9:"prototype";s:31:"dijit.layout.AccordionContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:9:"newWidget";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Widget";}s:9:"oldWidget";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Widget";}}s:6:"source";s:6066:"dojo.provide("dijit.layout.AccordionContainer");
dojo.require("dojo.fx");
dojo.require("dijit._Container");
dojo.require("dijit._Templated");
dojo.require("dijit.layout.StackContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.AccordionPane"); // for back compat
dojo.declare(
"dijit.layout.AccordionContainer",
dijit.layout.StackContainer,
{
// summary:
// Holds a set of panes where every pane's title is visible, but only one pane's content is visible at a time,
// and switching between panes is visualized by sliding the other panes up/down.
// example:
// |
// |
// |
// |
This is some text
// || ...
// |
// duration: Integer
// Amount of time (in ms) it takes to slide panes
duration: dijit.defaultDuration,
// _verticalSpace: Number
// Pixels of space available for the open pane
// (my content box size minus the cumulative size of all the title bars)
_verticalSpace: 0,
baseClass: "dijitAccordionContainer",
postCreate: function(){
this.domNode.style.overflow = "hidden";
this.inherited(arguments);
dijit.setWaiRole(this.domNode, "tablist");
},
startup: function(){
if(this._started){ return; }
this.inherited(arguments);
if(this.selectedChildWidget){
var style = this.selectedChildWidget.containerNode.style;
style.display = "";
style.overflow = "auto";
this.selectedChildWidget._buttonWidget._setSelectedState(true);
}
},
_getTargetHeight: function(/* Node */ node){
// summary:
// For the given node, returns the height that should be
// set to achieve our vertical space (subtract any padding
// we may have).
//
// This is used by the animations.
//
// TODO: I don't think this works correctly in IE quirks when an elements
// style.height including padding and borders
var cs = dojo.getComputedStyle(node);
return Math.max(this._verticalSpace - dojo._getPadBorderExtents(node, cs).h, 0);
},
layout: function(){
// Implement _LayoutWidget.layout() virtual method.
// Set the height of the open pane based on what room remains.
var openPane = this.selectedChildWidget;
// get cumulative height of all the title bars
var totalCollapsedHeight = 0;
dojo.forEach(this.getChildren(), function(child){
totalCollapsedHeight += child._buttonWidget.getTitleHeight();
});
var mySize = this._contentBox;
this._verticalSpace = mySize.h - totalCollapsedHeight;
// Memo size to make displayed child
this._containerContentBox = {
h: this._verticalSpace,
w: mySize.w
};
if(openPane){
openPane.resize(this._containerContentBox);
}
},
_setupChild: function(child){
// Overrides _LayoutWidget._setupChild().
// Setup clickable title to sit above the child widget,
// and stash pointer to it inside the widget itself.
child._buttonWidget = new dijit.layout._AccordionButton({
contentWidget: child,
title: child.title,
id: child.id + "_button",
parent: this
});
dojo.place(child._buttonWidget.domNode, child.domNode, "before");
this.inherited(arguments);
},
removeChild: function(child){
// Overrides _LayoutWidget.removeChild().
child._buttonWidget.destroy();
this.inherited(arguments);
},
getChildren: function(){
// Overrides _Container.getChildren() to ignore titles and only look at panes.
return dojo.filter(this.inherited(arguments), function(child){
return child.declaredClass != "dijit.layout._AccordionButton";
});
},
destroy: function(){
dojo.forEach(this.getChildren(), function(child){
child._buttonWidget.destroy();
});
this.inherited(arguments);
},
_transition: function(/*Widget?*/newWidget, /*Widget?*/oldWidget){
// Overrides StackContainer._transition() to provide sliding of title bars etc.
//TODO: should be able to replace this with calls to slideIn/slideOut
if(this._inTransition){ return; }
this._inTransition = true;
var animations = [];
var paneHeight = this._verticalSpace;
if(newWidget){
newWidget._buttonWidget.setSelected(true);
this._showChild(newWidget); // prepare widget to be slid in
// Size the new widget, in case this is the first time it's being shown,
// or I have been resized since the last time it was shown.
// Note that page must be visible for resizing to work.
if(this.doLayout && newWidget.resize){
newWidget.resize(this._containerContentBox);
}
var newContents = newWidget.domNode;
dojo.addClass(newContents, "dijitVisible");
dojo.removeClass(newContents, "dijitHidden");
var newContentsOverflow = newContents.style.overflow;
newContents.style.overflow = "hidden";
animations.push(dojo.animateProperty({
node: newContents,
duration: this.duration,
properties: {
height: { start: 1, end: this._getTargetHeight(newContents) }
},
onEnd: dojo.hitch(this, function(){
newContents.style.overflow = newContentsOverflow;
delete this._inTransition;
})
}));
}
if(oldWidget){
oldWidget._buttonWidget.setSelected(false);
var oldContents = oldWidget.domNode,
oldContentsOverflow = oldContents.style.overflow;
oldContents.style.overflow = "hidden";
animations.push(dojo.animateProperty({
node: oldContents,
duration: this.duration,
properties: {
height: { start: this._getTargetHeight(oldContents), end: 1 }
},
onEnd: function(){
dojo.addClass(oldContents, "dijitHidden");
dojo.removeClass(oldContents, "dijitVisible");
oldContents.style.overflow = oldContentsOverflow;
if(oldWidget.onHide){
oldWidget.onHide();
}
}
}));
}
dojo.fx.combine(animations).play();";s:7:"private";b:1;s:7:"summary";s:0:"";}s:43:"dijit.layout.AccordionContainer._onKeyPress";a:7:{s:9:"prototype";s:31:"dijit.layout.AccordionContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:1:"e";a:1:{s:4:"type";s:5:"Event";}s:9:"fromTitle";a:1:{s:4:"type";s:6:"Widget";}}s:6:"source";s:594:" if(this._inTransition || this.disabled || e.altKey || !(fromTitle || e.ctrlKey)){
if(this._inTransition){
dojo.stopEvent(e);
}
return;
}
var k = dojo.keys,
c = e.charOrCode;
if((fromTitle && (c == k.LEFT_ARROW || c == k.UP_ARROW)) ||
(e.ctrlKey && c == k.PAGE_UP)){
this._adjacent(false)._buttonWidget._onTitleClick();
dojo.stopEvent(e);
}else if((fromTitle && (c == k.RIGHT_ARROW || c == k.DOWN_ARROW)) ||
(e.ctrlKey && (c == k.PAGE_DOWN || c == k.TAB))){
this._adjacent(true)._buttonWidget._onTitleClick();
dojo.stopEvent(e);
}";s:7:"summary";s:22:"Handle keypress events";s:11:"description";s:158:"This is called from a handler on AccordionContainer.domNode
(setup in StackContainer), and is also called directly from
the click handler for accordion labels";s:7:"private";b:1;}s:54:"dijit.layout.AccordionContainer.domNode.style.overflow";a:2:{s:8:"instance";s:31:"dijit.layout.AccordionContainer";s:7:"summary";s:0:"";}s:52:"dijit.layout.AccordionContainer._containerContentBox";a:3:{s:8:"instance";s:31:"dijit.layout.AccordionContainer";s:7:"private";b:1;s:7:"summary";s:0:"";}s:45:"dijit.layout.AccordionContainer._inTransition";a:3:{s:8:"instance";s:31:"dijit.layout.AccordionContainer";s:7:"private";b:1;s:7:"summary";s:0:"";}s:29:"dijit.layout._AccordionButton";a:5:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:13:"dijit._Widget";}s:4:"call";a:2:{i:0;s:13:"dijit._Widget";i:1;s:16:"dijit._Templated";}}s:6:"mixins";a:1:{s:9:"prototype";a:1:{i:0;s:26:"dijit._Templated.prototype";}}s:7:"summary";s:110:"The title bar to click to open up an accordion pane.
Internal widget used by AccordionContainer.
tags:
private";s:9:"classlike";b:1;}s:42:"dijit.layout._AccordionButton.templatePath";a:2:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:7:"summary";s:0:"";}s:42:"dijit.layout._AccordionButton.attributeMap";a:2:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:7:"summary";s:0:"";}s:39:"dijit.layout._AccordionButton.baseClass";a:2:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:7:"summary";s:0:"";}s:39:"dijit.layout._AccordionButton.getParent";a:5:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:6:"source";s:21:" return this.parent;";s:7:"summary";s:19:"Returns the parent.";s:4:"tags";s:7:"private";}s:40:"dijit.layout._AccordionButton.postCreate";a:4:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:6:"source";s:330:" this.inherited(arguments);
dojo.setSelectable(this.domNode, false);
this.setSelected(this.selected);
var titleTextNodeId = dojo.attr(this.domNode,'id').replace(' ','_');
dojo.attr(this.titleTextNode, "id", titleTextNodeId+"_title");
dijit.setWaiState(this.focusNode, "labelledby", dojo.attr(this.titleTextNode, "id"));";s:7:"summary";s:0:"";}s:44:"dijit.layout._AccordionButton.getTitleHeight";a:5:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:6:"source";s:53:" return dojo.marginBox(this.titleNode).h; // Integer";s:7:"summary";s:41:"Returns the height of the title dom node.";s:7:"returns";s:7:"Integer";}s:43:"dijit.layout._AccordionButton._onTitleClick";a:5:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:6:"source";s:140:" var parent = this.getParent();
if(!parent._inTransition){
parent.selectChild(this.contentWidget);
dijit.focus(this.focusNode);
}";s:7:"summary";s:38:"Callback when someone clicks my title.";s:7:"private";b:1;}s:43:"dijit.layout._AccordionButton._onTitleEnter";a:5:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:6:"source";s:61:" dojo.addClass(this.focusNode, "dijitAccordionTitle-hover");";s:7:"summary";s:43:"Callback when someone hovers over my title.";s:7:"private";b:1;}s:43:"dijit.layout._AccordionButton._onTitleLeave";a:5:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:6:"source";s:64:" dojo.removeClass(this.focusNode, "dijitAccordionTitle-hover");";s:7:"summary";s:51:"Callback when someone stops hovering over my title.";s:7:"private";b:1;}s:46:"dijit.layout._AccordionButton._onTitleKeyPress";a:6:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:63:" return this.getParent()._onKeyPress(evt, this.contentWidget);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:47:"dijit.layout._AccordionButton._setSelectedState";a:6:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:10:"isSelected";a:1:{s:4:"type";s:7:"Boolean";}}s:6:"source";s:317:" this.selected = isSelected;
dojo[(isSelected ? "addClass" : "removeClass")](this.titleNode,"dijitAccordionTitle-selected");
dijit.setWaiState(this.focusNode, "expanded", isSelected);
dijit.setWaiState(this.focusNode, "selected", isSelected);
this.focusNode.setAttribute("tabIndex", isSelected ? "0" : "-1");";s:7:"private";b:1;s:7:"summary";s:0:"";}s:42:"dijit.layout._AccordionButton._handleFocus";a:6:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:5:"Event";}}s:6:"source";s:97:" dojo[(e.type=="focus" ? "addClass" : "removeClass")](this.focusNode,"dijitAccordionFocused"); ";s:7:"summary";s:47:"Handle the blur and focus state of this widget.";s:7:"private";b:1;}s:41:"dijit.layout._AccordionButton.setSelected";a:5:{s:9:"prototype";s:29:"dijit.layout._AccordionButton";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:10:"isSelected";a:1:{s:4:"type";s:7:"Boolean";}}s:6:"source";s:132:" this._setSelectedState(isSelected);
if(isSelected){
var cw = this.contentWidget;
if(cw.onSelected){ cw.onSelected(); }
}";s:7:"summary";s:39:"Change the selected state on this pane.";}s:38:"dijit.layout._AccordionButton.selected";a:2:{s:8:"instance";s:29:"dijit.layout._AccordionButton";s:7:"summary";s:0:"";}s:12:"dijit.layout";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dijit";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}