Changeset 6507
- Timestamp:
- Aug 7, 2014, 10:04:34 AM (8 years ago)
- Location:
- branches/3.3-stable/www/include/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-stable/www/include/scripts/main-2.js
r6506 r6507 1251 1251 {} 1252 1252 1253 if (App.rememberDialogPositions()) 1254 { 1255 Data.setPageValue('requested-position', JSON.stringify(position), name); 1256 } 1253 1257 options += ",top="+position.top+",left="+position.left+",width="+position.width+",height="+position.height; 1254 1258 var newWin; … … 1263 1267 newWin = window.open(url, name, options); 1264 1268 } 1269 1265 1270 newWin.focus(); 1266 1271 return newWin; -
branches/3.3-stable/www/include/scripts/popup.js
r6506 r6507 26 26 var popup = {}; 27 27 var internal = {}; 28 var dx = 0; 29 var dy = 0; 28 30 29 31 // If the popup dialog is read-only BASE will not … … 34 36 } 35 37 38 // Need short delay to ensure that window is properly initialized 39 internal.delayInitPosition = function() 40 { 41 setTimeout(internal.initPosition, 20); 42 } 43 44 // Correct size of the window if the actual size is different from the requested 45 // Firefox has -1 pixel height and IE has +4 pixels width and height 46 internal.initPosition = function() 47 { 48 if (window.top.name && App.rememberDialogPositions()) 49 { 50 var rpos = JSON.parse(Data.getPageValue("requested-position", window.top.name)); 51 var cpos = App.getWindowPosition(window.top); 52 dx = rpos.width-cpos.width; 53 dy = rpos.height-cpos.height; 54 } 55 } 56 36 57 internal.savePosition = function() 37 58 { 38 59 if (window.top.name && App.rememberDialogPositions()) 39 60 { 40 var pos = JSON.stringify(App.getWindowPosition(window.top)); 41 Data.setPageValue("last-position", pos, window.top.name); 61 var pos = App.getWindowPosition(window.top); 62 pos.width += dx; 63 pos.height += dy; 64 Data.setPageValue("last-position", JSON.stringify(pos), window.top.name); 42 65 } 43 66 } 44 67 68 document.addEventListener('DOMContentLoaded', internal.delayInitPosition, false); 45 69 window.addEventListener('beforeunload', internal.savePosition, false); 46 70
Note: See TracChangeset
for help on using the changeset viewer.