public
Fork of xilinus/prototypeui
Description: Prototype UI
Homepage: http://prototype-ui.com
Clone URL: git://github.com/starpeak/prototypeui.git
Added separators to tabbox
starpeak (author)
Sun Aug 17 07:04:35 -0700 2008
commit  9ef3f79b1d0dd2c8001654aeed809977872ee20c
tree    126c052518227a8ebd6c9da27575e5562f256f57
parent  e646f439fd9121655a319a824676d46abeda0fb9
...
31
32
33
34
 
 
 
 
35
36
37
...
141
142
143
 
 
 
 
 
 
 
 
 
 
144
145
146
...
31
32
33
 
34
35
36
37
38
39
40
...
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
0
@@ -31,7 +31,10 @@ UI.Tabbox = Class.create(UI.Options, {
0
     this.head=new Element('div',{className:'tabbox_head'});
0
     
0
     tabs.each(function(tab) {
0
-      this.add(tab);
0
+      if(tab == 'separator')
0
+        this.addSeparator(new Hash);    
0
+      else
0
+        this.add(tab);
0
     }.bind(this));
0
     
0
     this.element.insert({
0
@@ -141,6 +144,16 @@ UI.Tabbox = Class.create(UI.Options, {
0
           
0
       this.tabs.set(tab.name,tab);    
0
   },
0
+  
0
+  addSeparator: function(tab) {
0
+    head=new Element('span', {className: 'separator'});
0
+    
0
+    if(tab.after && this.tabs.get(tab.after)) {
0
+      this.tabs.get(tab.after).head.insert({after:head});
0
+    } else {
0
+      this.head.insert(head);
0
+    }
0
+  },
0
 
0
   select: function(tabName) {
0
     if (this.selectedTab && this.selectedTab.name == tabName) {

Comments