Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
diff --git a/public/javascripts/control.tabs.js b/public/javascripts/control.tabs.js index ec69bc4..1cd6b72 100644 --- a/public/javascripts/control.tabs.js +++ b/public/javascripts/control.tabs.js @@ -85,7 +85,7 @@ Object.extend(Control.Tabs.prototype,{ addTab: function(link){ this.links.push(link); link.key = link.getAttribute('href').replace(window.location.href.split('#')[0],'').split('/').last().replace(/#/,''); - this.containers[link.key] = $(link.key); + this.containers.set(link.key, $(link.key)); link[this.options.hover ? 'onmouseover' : 'onclick'] = function(link){ if(window.event) Event.stop(window.event); @@ -111,10 +111,10 @@ Object.extend(Control.Tabs.prototype,{ (this.options.setClassOnContainer ? $(item.parentNode) : item).removeClassName(this.options.activeClassName); }.bind(this)); (this.options.setClassOnContainer ? $(link.parentNode) : link).addClassName(this.options.activeClassName); - this.activeContainer = this.containers[link.key]; + this.activeContainer = this.containers.get(link.key); this.activeLink = link; - this.options.showFunction(this.containers[link.key]); - this.notify('afterChange',this.containers[link.key]); + this.options.showFunction(this.containers.get(link.key)); + this.notify('afterChange',this.containers.get(link.key)); } }, next: function(){
This paste will be private.
From the Design Piracy series on my blog: