diff options
author | chrisaga <chrisaga@piwigo.org> | 2006-07-14 23:58:51 +0000 |
---|---|---|
committer | chrisaga <chrisaga@piwigo.org> | 2006-07-14 23:58:51 +0000 |
commit | f34f88614d5b81ddee55626d998bfb7cde8b34cf (patch) | |
tree | 2135173d024033713766040a4bdeb5ee40348a65 /include | |
parent | 6f5cdb1265bfe7585b94021f4dcc3b64c99996ec (diff) |
merge from trunk r1467:1468 into branch 1.6 (bug 437 popup-window size )
git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1469 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r-- | include/scripts.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/scripts.js b/include/scripts.js index 58bc55a7a..a96775ce4 100644 --- a/include/scripts.js +++ b/include/scripts.js @@ -40,9 +40,32 @@ for( i=0; i<len; i++) } } +function verifieAndOpen() +{ + var ok=1; + if (!img.complete) + { + // sometime the image loading is not complete + // especially with KHTML and Opera + setTimeout("verifieAndOpen()",200) + } + else + { + /* give more space for scrollbars (10 for FF, 40 for IE) */ + width=img.width +40; + height=img.height +40; + window.open(owURL,owName,owFeatures + ',width=' + width + ',height=' + height); + } +} + function phpWGOpenWindow(theURL,winName,features) { - window.open(theURL,winName,features); + img = new Image() + img.src = theURL; + owURL=theURL; + owName=winName; + owFeatures=features; + verifieAndOpen(); } function popuphelp(url) |