Changeset 6114
- Timestamp:
- 04/23/10 18:09:46 (3 years ago)
- Location:
- luci2/nyu2/src
- Files:
-
- 2 modified
-
nyu2/widget.js (modified) (4 diffs)
-
style.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci2/nyu2/src/nyu2/widget.js
r6113 r6114 26 26 if (this.container && this.container != this) { 27 27 this.container.registry[this.name] = this; 28 } 29 if (!this.caption) { 30 this.caption = this.name; 28 31 } 29 32 … … 39 42 40 43 if (!this.isPlain) { 44 this.body = $('<div class="nyu2-widget-body" />'); 45 41 46 this.header = $("<div />"); 42 this.body = $('<div class="nyu2-widget-body" />');43 47 this.footer = $('<div class="nyu2-widget-footer" />');; 44 48 … … 63 67 var child = nyu2.parseWidget(key, options.elements[key], this); 64 68 if (child) { 65 this.append(child );69 this.append(child, key); 66 70 } 67 71 } … … 148 152 this.node.addClass(options.css); 149 153 } 150 } 154 }, 151 155 }); 152 156 153 157 nyu2.widget.Iterate = nyu2.declare(nyu2.Widget, { 154 158 isContainer: true, 155 isSection: true 159 isSection: true, 160 useTabular: true, 161 162 prepare: function(options) { 163 this.elements = {}; 164 }, 165 166 complete: function(options) { 167 if (this.useTabular) { 168 this.sectiontable = $("<table />").appendTo(this.body); 169 var titlerow = $("<tr />").appendTo(this.sectiontable); 170 for (var key in this.elements) { 171 titlerow.append($("<th />").text(this.elements[key].caption)); 172 } 173 } 174 }, 175 176 append: function(child, key) { 177 if (child.isPlain || child.isContainer) { 178 this.children.push(child); 179 this.body.append(child.node); 180 } else { 181 this.elements[key] = child; 182 } 183 } 156 184 }); 157 185 -
luci2/nyu2/src/style.css
r6113 r6114 4 4 5 5 #nyu2-main { 6 width: 300px;6 max-width: 400px; 7 7 } 8 8
