Changeset 1767
- Timestamp:
- 10/20/06 17:27:10 (2 years ago)
- Files:
-
- spinelz/trunk/src/javascripts/spinelz/window.js (modified) (2 diffs)
- spinelz/trunk/src/stylesheets/spinelz/window.css (modified) (1 diff)
- spinelz/trunk/test/window.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinelz/trunk/src/javascripts/spinelz/window.js
r1754 r1767 106 106 restriction: false, 107 107 endDrag: Prototype.emptyFunction, 108 endResize: Prototype.emptyFunction 108 endResize: Prototype.emptyFunction, 109 addButton: Prototype.emptyFunction 109 110 }, arguments[1] || {}); 110 111 … … 211 212 Event.observe(minButton, 'click', this.minimize.bindAsEventListener(this)); 212 213 } 213 214 215 if (this.options.addButton) { 216 var addButton = this.options.addButton; 217 if (addButton.constructor == Function) { 218 addButton(buttonHolder); 219 } else if (addButton.constructor == Array) { 220 var self = this; 221 var firstChild = buttonHolder.firstChild; 222 addButton.each(function(b) { 223 var button = Builder.node('div', {id: b.id, className: b.className}); 224 Event.observe(button, 'click', b.onclick.bindAsEventListener(self)); 225 if (b.first && firstChild) { 226 buttonHolder.insertBefore(button, firstChild); 227 } else { 228 buttonHolder.appendChild(button); 229 } 230 }); 231 } 232 } 214 233 }, 215 234 216 235 buildBody: function(contents) { 217 218 236 var bodyLeft = Builder.node('div', {className: Window.className.bodyLeft}); 219 237 this.classNames.addClassNames(bodyLeft, 'bodyLeft'); spinelz/trunk/src/stylesheets/spinelz/window.css
r1496 r1767 46 46 47 47 .window_buttonHolder{ 48 width: 4 2px;48 width: 48px; 49 49 height: 12px; 50 50 position: absolute; spinelz/trunk/test/window.html
r1754 r1767 24 24 width: 300px; 25 25 height: 300px; 26 } 27 28 .test_button_class { 29 float:right; 30 border: 0px; 31 overflow: hidden; 32 cursor:pointer; 33 font-size: 5px; 34 width: 12px; 35 height:12px; 36 background-image: url('../src/images/spinelz/tabBox_close.gif'); 37 background-repeat: no-repeat; 38 background-position: 0 0; 26 39 } 27 40 </style> … … 115 128 var win3 = new Window('window3',{modal:true, resize: false, maxButton: false}); 116 129 117 var win4 = new Window('restrictionWindow',{restriction: true, width: 100, height: 100}); 130 var win4 = new Window('restrictionWindow', 131 { 132 restriction: true, 133 width: 100, 134 height: 100, 135 addButton: [ 136 {id: 'test_button_id', className: 'test_button_class', onclick: function() {alert('click button!')}} 137 ] 138 }); 118 139 win4.open(); 119 140
