Index: /spinelz/trunk/src/javascripts/spinelz/tabBox.js =================================================================== --- /spinelz/trunk/src/javascripts/spinelz/tabBox.js (revision 5939) +++ /spinelz/trunk/src/javascripts/spinelz/tabBox.js (revision 6025) @@ -350,4 +350,5 @@ if (index == this.selected) { if (nextActiveTab) { + this.selected = null; this.selectTab(nextActiveTab); } @@ -460,10 +461,12 @@ }, - getNextTab: function() { - return Element.next(this.getCurrentTab()); - }, - - getPreviousTab: function() { - return Element.previous(this.getCurrentTab()); + getNextTab: function(tab) { + var e = Element.next(tab || this.getCurrentTab()); + return (e && e.tagName.toLowerCase() == 'br') ? this.getNextTab(e) : e; + }, + + getPreviousTab: function(tab) { + var e = Element.previous(tab || this.getCurrentTab()); + return (e && e.tagName.toLowerCase() == 'br') ? this.getPreviousTab(e) : e; }, Index: /spinelz/trunk/compress/javascripts/spinelz/tabBox.js =================================================================== --- /spinelz/trunk/compress/javascripts/spinelz/tabBox.js (revision 5939) +++ /spinelz/trunk/compress/javascripts/spinelz/tabBox.js (revision 6025) @@ -248,4 +248,5 @@ if(_3f==this.selected){ if(_40){ +this.selected=null; this.selectTab(_40); } @@ -335,8 +336,10 @@ },hasPreviousTab:function(){ return this.getPreviousTab()?true:false; -},getNextTab:function(){ -return Element.next(this.getCurrentTab()); -},getPreviousTab:function(){ -return Element.previous(this.getCurrentTab()); +},getNextTab:function(tab){ +var e=Element.next(tab||this.getCurrentTab()); +return (e&&e.tagName.toLowerCase()=="br")?this.getNextTab(e):e; +},getPreviousTab:function(tab){ +var e=Element.previous(tab||this.getCurrentTab()); +return (e&&e.tagName.toLowerCase()=="br")?this.getPreviousTab(e):e; },selectNextTab:function(){ this.selectTab(this.getNextTab()); @@ -353,44 +356,44 @@ },getLastTab:function(){ return this.tabs.last(); -},_callBeforeSelect:function(_5d){ -var _5e=this._findCallback(this.options.beforeSelect,_5d); -return (_5e)?_5e():true; -},_callAfterSelect:function(_5f,_60){ -var _61=this._findCallback(this.options.afterSelect,_5f); -if(_61){ -_61(_5f,_60); -} -},_callAfterSelectOnce:function(_62){ -var _63=this._findCallback(this.options.afterSelectOnce,_62); -if(_63){ -_63(_62); -} -},_findCallback:function(_64,_65){ -if(!_64){ -return; -} -if(_64.constructor!=Function){ -if(_64.constructor==Array){ -_64=_64[this.panelList.indexOf(_65)]; -}else{ -_64=_64[this.panelList.indexOf(_65).succ()]; -} -} -return _64; +},_callBeforeSelect:function(_61){ +var _62=this._findCallback(this.options.beforeSelect,_61); +return (_62)?_62():true; +},_callAfterSelect:function(_63,_64){ +var _65=this._findCallback(this.options.afterSelect,_63); +if(_65){ +_65(_63,_64); +} +},_callAfterSelectOnce:function(_66){ +var _67=this._findCallback(this.options.afterSelectOnce,_66); +if(_67){ +_67(_66); +} +},_findCallback:function(_68,_69){ +if(!_68){ +return; +} +if(_68.constructor!=Function){ +if(_68.constructor==Array){ +_68=_68[this.panelList.indexOf(_69)]; +}else{ +_68=_68[this.panelList.indexOf(_69).succ()]; +} +} +return _68; },_setBrTag:function(){ if(this.options.tabRow){ -var _66=this.tabContainer; -var _67=[]; +var _6a=this.tabContainer; +var _6b=[]; var brs=[]; -Element.getTagNodes(_66).each(function(n){ -((n.tagName.toLowerCase()=="div")?_67:brs).push(n); -}); -_67.each(function(t,i){ +Element.getTagNodes(_6a).each(function(n){ +((n.tagName.toLowerCase()=="div")?_6b:brs).push(n); +}); +_6b.each(function(t,i){ if((i.succ()%this.options.tabRow)==0){ if(brs[0]){ -_66.insertBefore(brs[0],t.nextSibling); +_6a.insertBefore(brs[0],t.nextSibling); brs.shift(); }else{ -_66.insertBefore(Builder.node("br",{style:"clear: both"}),t.nextSibling); +_6a.insertBefore(Builder.node("br",{style:"clear: both"}),t.nextSibling); } } Index: /spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js =================================================================== --- /spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js (revision 6024) +++ /spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js (revision 6025) @@ -4882,4 +4882,5 @@ if(_3f==this.selected){ if(_40){ +this.selected=null; this.selectTab(_40); } @@ -4969,8 +4970,10 @@ },hasPreviousTab:function(){ return this.getPreviousTab()?true:false; -},getNextTab:function(){ -return Element.next(this.getCurrentTab()); -},getPreviousTab:function(){ -return Element.previous(this.getCurrentTab()); +},getNextTab:function(tab){ +var e=Element.next(tab||this.getCurrentTab()); +return (e&&e.tagName.toLowerCase()=="br")?this.getNextTab(e):e; +},getPreviousTab:function(tab){ +var e=Element.previous(tab||this.getCurrentTab()); +return (e&&e.tagName.toLowerCase()=="br")?this.getPreviousTab(e):e; },selectNextTab:function(){ this.selectTab(this.getNextTab()); @@ -4987,44 +4990,44 @@ },getLastTab:function(){ return this.tabs.last(); -},_callBeforeSelect:function(_5d){ -var _5e=this._findCallback(this.options.beforeSelect,_5d); -return (_5e)?_5e():true; -},_callAfterSelect:function(_5f,_60){ -var _61=this._findCallback(this.options.afterSelect,_5f); -if(_61){ -_61(_5f,_60); -} -},_callAfterSelectOnce:function(_62){ -var _63=this._findCallback(this.options.afterSelectOnce,_62); -if(_63){ -_63(_62); -} -},_findCallback:function(_64,_65){ -if(!_64){ -return; -} -if(_64.constructor!=Function){ -if(_64.constructor==Array){ -_64=_64[this.panelList.indexOf(_65)]; -}else{ -_64=_64[this.panelList.indexOf(_65).succ()]; -} -} -return _64; +},_callBeforeSelect:function(_61){ +var _62=this._findCallback(this.options.beforeSelect,_61); +return (_62)?_62():true; +},_callAfterSelect:function(_63,_64){ +var _65=this._findCallback(this.options.afterSelect,_63); +if(_65){ +_65(_63,_64); +} +},_callAfterSelectOnce:function(_66){ +var _67=this._findCallback(this.options.afterSelectOnce,_66); +if(_67){ +_67(_66); +} +},_findCallback:function(_68,_69){ +if(!_68){ +return; +} +if(_68.constructor!=Function){ +if(_68.constructor==Array){ +_68=_68[this.panelList.indexOf(_69)]; +}else{ +_68=_68[this.panelList.indexOf(_69).succ()]; +} +} +return _68; },_setBrTag:function(){ if(this.options.tabRow){ -var _66=this.tabContainer; -var _67=[]; +var _6a=this.tabContainer; +var _6b=[]; var brs=[]; -Element.getTagNodes(_66).each(function(n){ -((n.tagName.toLowerCase()=="div")?_67:brs).push(n); -}); -_67.each(function(t,i){ +Element.getTagNodes(_6a).each(function(n){ +((n.tagName.toLowerCase()=="div")?_6b:brs).push(n); +}); +_6b.each(function(t,i){ if((i.succ()%this.options.tabRow)==0){ if(brs[0]){ -_66.insertBefore(brs[0],t.nextSibling); +_6a.insertBefore(brs[0],t.nextSibling); brs.shift(); }else{ -_66.insertBefore(Builder.node("br",{style:"clear: both"}),t.nextSibling); +_6a.insertBefore(Builder.node("br",{style:"clear: both"}),t.nextSibling); } }