tabview.js revision ee84d6929652e6eb1aba183971322a1fc4bfa607
/**
* The TabView module
*
* @module tabview
*/
DOT = '.',
/**
* Provides a tabbed widget interface
* @param config {Object} Object literal specifying tabview configuration properties.
*
* @class TabView
* @constructor
* @extends Widget
* @uses WidgetParent
*/
_afterChildAdded: function(e) {
},
_defListNodeValueFn: function() {
},
_defPanelNodeValueFn: function() {
},
_afterChildRemoved: function(e) { // update the selected tab when removed
var i = e.index,
if (!selection) { // select previous item if selection removed
if (selection) {
}
}
},
_initAria: function() {
if (tablist) {
//'aria-labelledby':
});
}
},
bindUI: function() {
// Use the Node Focus Manager to add keyboard support:
// Pressing the left and right arrow keys will move focus
// among each of the tabs.
circular: true
});
},
renderUI: function() {
this._renderListBox(contentBox);
this._renderPanelBox(contentBox);
this._renderTabs(contentBox);
},
_setDefSelection: function(contentBox) {
// If no tab is selected, select the first tab.
return true;
}
});
if (selection) {
// TODO: why both needed? (via widgetParent/Child)?
}
},
_renderListBox: function(contentBox) {
}
},
_renderPanelBox: function(contentBox) {
}
},
_renderTabs: function(contentBox) {
tabview = this;
if (tabs) { // add classNames and fill in Tab fields from markup when possible
});
});
}
}
}, {
ATTRS: {
value: 'Tab'
},
listNode: {
if (node) {
}
return node;
},
valueFn: '_defListNodeValueFn'
},
panelNode: {
if (node) {
}
return node;
},
valueFn: '_defPanelNodeValueFn'
},
tabIndex: {
value: null
//validator: '_validTabIndex'
}
},
HTML_PARSER: {
}
});
/**
* Provides Tab instances for use with TabView
* @param config {Object} Object literal specifying tabview configuration properties.
*
* @class Tab
* @constructor
* @extends Widget
* @uses WidgetChild
*/
_uiSetSelectedPanel: function(selected) {
},
_afterTabSelectedChange: function(event) {
},
_afterParentChange: function(e) {
if (!e.newVal) {
this._remove();
} else {
this._add();
}
},
_initAria: function() {
if (!id) {
}
// Apply the ARIA roles, states and properties to each tab
// Apply the ARIA roles, states and properties to each panel
role: 'tabpanel',
'aria-labelledby': id
});
},
syncUI: function() {
},
bindUI: function() {
},
renderUI: function() {
this._renderPanel();
this._initAria();
},
_renderPanel: function() {
},
_add: function() {
if (list) {
}
if (panel) {
}
},
_remove: function() {
},
_onActivate: function(e) {
if (e.target === this) {
// Prevent the browser from navigating to the URL specified by the
// anchor's href attribute.
e.domEvent.preventDefault();
}
},
initializer: function() {
defaultFn: this._onActivate
});
},
_defLabelSetter: function(label) {
return label;
},
_defContentSetter: function(content) {
return content;
},
// find panel by ID mapping from label href
_defPanelNodeValueFn: function() {
var id,
} else {
}
// use the one found by id, or else try matching indices
if (parent) {
}
if (!panel) {
}
return panel;
}
}, {
ATTRS: {
/**
* @attribute triggerEvent
* @default "click"
* @type String
*/
triggerEvent: {
value: 'click'
},
/**
* @attribute label
* @type String
*/
label: {
setter: '_defLabelSetter',
},
/**
* @attribute content
* @type String
*/
content: {
setter: '_defContentSetter',
},
/**
* @attribute panelNode
* @type Y.Node
*/
panelNode: {
if (node) {
}
return node;
},
valueFn: '_defPanelNodeValueFn'
},
tabIndex: {
value: null,
validator: '_validTabIndex'
}
},
HTML_PARSER: {
selected: function(contentBox) {
}
}
});
}, '@VERSION@' ,{requires:['substitute', 'node-focusmanager', 'tabview-base', 'widget', 'widget-parent', 'widget-child']});