Changeset 5379
- Timestamp:
- 05/02/08 14:28:31 (7 months ago)
- Location:
- trunk/ui
- Files:
-
- 2 modified
-
tests/uiTest.dialog.js (modified) (1 diff)
-
ui.dialog.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/tests/uiTest.dialog.js
r5027 r5379 60 60 "Array-300-80" : "$('#foo').dialog({\n\t position: [300, 80] \n});", 61 61 "Array-80-300" : "$('#foo').dialog({\n\t position: [80, 300] \n});", 62 "Array-left-50" : "$('#foo').dialog({\n\t position: ['left', 50] \n});", 63 "Array-right-bottom" : "$('#foo').dialog({\n\t position: ['right', 'bottom'] \n});", 64 "Array-80-middle" : "$('#foo').dialog({\n\t position: [80, 'middle'] \n});", 65 "Array-foo-top" : "$('#foo').dialog({\n\t position: ['foo', 'top'] \n});", 66 "Array-100-foo" : "$('#foo').dialog({\n\t position: [100, 'foo'] \n});", 62 67 "foo" : "$('#foo').dialog({\n\t position: 'foo' \n});" 63 68 }, -
trunk/ui/ui.dialog.js
r5376 r5379 207 207 if (pos.constructor == Array) { 208 208 // [x, y] 209 top += pos[1]; 210 left += pos[0]; 209 if (pos[0].constructor == Number) { 210 left += pos[0]; 211 } else { 212 switch (pos[0]) { 213 case 'center': 214 left += (wnd.width() / 2) - (uiDialog.width() / 2); 215 break; 216 case 'left': 217 left += 0; 218 break; 219 case 'right': 220 left += (wnd.width()) - (uiDialog.width()); 221 break; 222 default: 223 //center 224 left += (wnd.width() / 2) - (uiDialog.width() / 2); 225 } 226 } 227 if (pos[1].constructor == Number) { 228 top += pos[1]; 229 } else { 230 switch (pos[1]) { 231 case 'middle': 232 top += (wnd.height() / 2) - (uiDialog.height() / 2); 233 break; 234 case 'top': 235 top += 0; 236 break; 237 case 'bottom': 238 top += (wnd.height()) - (uiDialog.height()); 239 break; 240 default: 241 //middle 242 top += (wnd.height() / 2) - (uiDialog.height() / 2); 243 } 244 } 211 245 } else { 212 246 switch (pos) {
