public/javascripts/yui/tabview/tabview.js
function(attr) {
            TabView.superclass.initAttributes.call(this, attr);
            
            if (!attr.orientation) {
                attr.orientation = 'top';
            }
            
            var el = this.get(ELEMENT);

            if (!Dom.hasClass(el, this.CLASSNAME)) {
                Dom.addClass(el, this.CLASSNAME);        
            }
            
            /**
             * The Tabs belonging to the TabView instance.
             * @attribute tabs
             * @type Array
             */
            this.setAttributeConfig('tabs', {
                value: [],
                readOnly: true
            });

            /**
             * The container of the tabView's label elements.
             * @property _tabParent
             * @private
             * @type HTMLElement
             */
            this._tabParent = 
                    this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
                            'ul' )[0] || this._createTabParent();
                
            /**
             * The container of the tabView's content elements.
             * @property _contentParent
             * @type HTMLElement
             * @private
             */
            this._contentParent = 
                    this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
                            'div')[0] ||  this._createContentParent();
            
            /**
             * How the Tabs should be oriented relative to the TabView.
             * @attribute orientation
             * @type String
             * @default "top"
             */
            this.setAttributeConfig('orientation', {
                value: attr.orientation,
                method: function(value) {
                    var current = this.get('orientation');
                    this.addClass('yui-navset-' + value);
                    
                    if (current != value) {
                        this.removeClass('yui-navset-' + current);
                    }
                    
                    if (value === 'bottom') {
                        this.appendChild(this._tabParent);
                    }
                }
            });
            
            /**
             * The index of the tab currently active.
             * @attribute activeIndex
             * @type Int
             */
            this.setAttributeConfig(ACTIVE_INDEX, {
                value: attr.activeIndex,
                validator: function(value) {
                    var ret = true;
                    if (value && this.getTab(value).get('disabled')) { // cannot activate if disabled
                        ret = false;
                    }
                    return ret;
                }
            });
            
            /**
             * The tab currently active.
             * @attribute activeTab
             * @type YAHOO.widget.Tab
             */
            this.setAttributeConfig(ACTIVE_TAB, {
                value: attr.activeTab,
                method: function(tab) {
                    var activeTab = this.get(ACTIVE_TAB);
                    
                    if (tab) {
                        tab.set(ACTIVE, true);
                    }
                    
                    if (activeTab && activeTab !== tab) {
                        activeTab.set(ACTIVE, false);
                    }
                    
                    if (activeTab && tab !== activeTab) { // no transition if only 1
                        this.contentTransition(tab, activeTab);
                    } else if (tab) {
                        tab.set('contentVisible', true);
                    }
                },
                validator: function(value) {
                    var ret = true;
                    if (value && value.get('disabled')) { // cannot activate if disabled
                        ret = false;
                    }
                    return ret;
                }
            });

            this.on('activeTabChange', this._onActiveTabChange);
            this.on('activeIndexChange', this._onActiveIndexChange);

            if ( this._tabParent ) {
                this._initTabs();
            }
            
            // Due to delegation we add all DOM_EVENTS to the TabView container
            // but IE will leak when unsupported events are added, so remove these
            this.DOM_EVENTS.submit = false;
            this.DOM_EVENTS.focus = false;
            this.DOM_EVENTS.blur = false;

            for (var type in this.DOM_EVENTS) {
                if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
                    this.addListener.call(this, type, this.DOMEventHandler);
                }
            }
        }
function(attr) {
            TabView.superclass.initAttributes.call(this, attr);
            
            if (!attr.orientation) {
                attr.orientation = 'top';
            }
            
            var el = this.get(ELEMENT);

            if (!Dom.hasClass(el, this.CLASSNAME)) {
                Dom.addClass(el, this.CLASSNAME);        
            }
            
            /**
             * The Tabs belonging to the TabView instance.
             * @attribute tabs
             * @type Array
             */
            this.setAttributeConfig('tabs', {
                value: [],
                readOnly: true
            });

            /**
             * The container of the tabView's label elements.
             * @property _tabParent
             * @private
             * @type HTMLElement
             */
            this._tabParent = 
                    this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,
                            'ul' )[0] || this._createTabParent();
                
            /**
             * The container of the tabView's content elements.
             * @property _contentParent
             * @type HTMLElement
             * @private
             */
            this._contentParent = 
                    this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,
                            'div')[0] ||  this._createContentParent();
            
            /**
             * How the Tabs should be oriented relative to the TabView.
             * @attribute orientation
             * @type String
             * @default "top"
             */
            this.setAttributeConfig('orientation', {
                value: attr.orientation,
                method: function(value) {
                    var current = this.get('orientation');
                    this.addClass('yui-navset-' + value);
                    
                    if (current != value) {
                        this.removeClass('yui-navset-' + current);
                    }
                    
                    if (value === 'bottom') {
                        this.appendChild(this._tabParent);
                    }
                }
            });
            
            /**
             * The index of the tab currently active.
             * @attribute activeIndex
             * @type Int
             */
            this.setAttributeConfig(ACTIVE_INDEX, {
                value: attr.activeIndex,
                validator: function(value) {
                    var ret = true;
                    if (value && this.getTab(value).get('disabled')) { // cannot activate if disabled
                        ret = false;
                    }
                    return ret;
                }
            });
            
            /**
             * The tab currently active.
             * @attribute activeTab
             * @type YAHOO.widget.Tab
             */
            this.setAttributeConfig(ACTIVE_TAB, {
                value: attr.activeTab,
                method: function(tab) {
                    var activeTab = this.get(ACTIVE_TAB);
                    
                    if (tab) {
                        tab.set(ACTIVE, true);
                    }
                    
                    if (activeTab && activeTab !== tab) {
                        activeTab.set(ACTIVE, false);
                    }
                    
                    if (activeTab && tab !== activeTab) { // no transition if only 1
                        this.contentTransition(tab, activeTab);
                    } else if (tab) {
                        tab.set('contentVisible', true);
                    }
                },
                validator: function(value) {
                    var ret = true;
                    if (value && value.get('disabled')) { // cannot activate if disabled
                        ret = false;
                    }
                    return ret;
                }
            });

            this.on('activeTabChange', this._onActiveTabChange);
            this.on('activeIndexChange', this._onActiveIndexChange);

            if ( this._tabParent ) {
                this._initTabs();
            }
            
            // Due to delegation we add all DOM_EVENTS to the TabView container
            // but IE will leak when unsupported events are added, so remove these
            this.DOM_EVENTS.submit = false;
            this.DOM_EVENTS.focus = false;
            this.DOM_EVENTS.blur = false;

            for (var type in this.DOM_EVENTS) {
                if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
                    this.addListener.call(this, type, this.DOMEventHandler);
                }
            }
        }
function ( attr ) { TabView . superclass . initAttributes . call ( this , attr ) ; if ( ! attr . orientation ) { attr . orientation = 'top' ; } var el = this . get ( ELEMENT ) ; if ( ! Dom . hasClass ( el , this . CLASSNAME ) ) { Dom . addClass ( el , this . CLASSNAME ) ; } /**
             * The Tabs belonging to the TabView instance.
             * @attribute tabs
             * @type Array
             */ this . setAttributeConfig ( 'tabs' , { value : [ ] , readOnly : true } ) ; /**
             * The container of the tabView's label elements.
             * @property _tabParent
             * @private
             * @type HTMLElement
             */ this . _tabParent = this . getElementsByClassName ( this . TAB_PARENT_CLASSNAME , 'ul' ) [ 0 ] || this . _createTabParent ( ) ; /**
             * The container of the tabView's content elements.
             * @property _contentParent
             * @type HTMLElement
             * @private
             */ this . _contentParent = this . getElementsByClassName ( this . CONTENT_PARENT_CLASSNAME , 'div' ) [ 0 ] || this . _createContentParent ( ) ; /**
             * How the Tabs should be oriented relative to the TabView.
             * @attribute orientation
             * @type String
             * @default "top"
             */ this . setAttributeConfig ( 'orientation' , { value : attr . orientation , method : function ( value ) { var current = this . get ( 'orientation' ) ; this . addClass ( 'yui-navset-' + value ) ; if ( current != value ) { this . removeClass ( 'yui-navset-' + current ) ; } if ( value === 'bottom' ) { this . appendChild ( this . _tabParent ) ; } } } ) ; /**
             * The index of the tab currently active.
             * @attribute activeIndex
             * @type Int
             */ this . setAttributeConfig ( ACTIVE_INDEX , { value : attr . activeIndex , validator : function ( value ) { var ret = true ; if ( value && this . getTab ( value ) . get ( 'disabled' ) ) { // cannot activate if disabled ret = false ; } return ret ; } } ) ; /**
             * The tab currently active.
             * @attribute activeTab
             * @type YAHOO.widget.Tab
             */ this . setAttributeConfig ( ACTIVE_TAB , { value : attr . activeTab , method : function ( tab ) { var activeTab = this . get ( ACTIVE_TAB ) ; if ( tab ) { tab . set ( ACTIVE , true ) ; } if ( activeTab && activeTab !== tab ) { activeTab . set ( ACTIVE , false ) ; } if ( activeTab && tab !== activeTab ) { // no transition if only 1 this . contentTransition ( tab , activeTab ) ; } else if ( tab ) { tab . set ( 'contentVisible' , true ) ; } } , validator : function ( value ) { var ret = true ; if ( value && value . get ( 'disabled' ) ) { // cannot activate if disabled ret = false ; } return ret ; } } ) ; this . on ( 'activeTabChange' , this . _onActiveTabChange ) ; this . on ( 'activeIndexChange' , this . _onActiveIndexChange ) ; if ( this . _tabParent ) { this . _initTabs ( ) ; } // Due to delegation we add all DOM_EVENTS to the TabView container // but IE will leak when unsupported events are added, so remove these this . DOM_EVENTS . submit = false ; this . DOM_EVENTS . focus = false ; this . DOM_EVENTS . blur = false ; for ( var type in this . DOM_EVENTS ) { if ( YAHOO . lang . hasOwnProperty ( this . DOM_EVENTS , type ) ) { this . addListener . call ( this , type , this . DOMEventHandler ) ; } } }
setAttributeConfigs TabView specific properties.
@method initAttributes
@param {Object} attr Hash of initial attributes
setAttributeConfigs TabView specific properties .