From 4795658fec727476904a0a2189e746715e2697ca Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 11 Jun 2010 12:31:29 +0000 Subject: [PATCH] for egw_openWindowCentered return a WindowID by default --- phpgwapi/js/jsapi/jsapi.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/phpgwapi/js/jsapi/jsapi.js b/phpgwapi/js/jsapi/jsapi.js index e1f1f3728d..67a9ddcadf 100644 --- a/phpgwapi/js/jsapi/jsapi.js +++ b/phpgwapi/js/jsapi/jsapi.js @@ -103,8 +103,10 @@ function egw_set_checkbox_multiselect_enabled(_id, _enabled) } // works only correctly in Mozilla/FF and Konqueror -function egw_openWindowCentered2(_url, _windowName, _width, _height, _status) +function egw_openWindowCentered2(_url, _windowName, _width, _height, _status, _app, _returnID) { + if (typeof(_app) == 'undefined') _app = false; + if (typeof(_returnID) == 'undefined') _returnID = false; windowWidth = egw_getWindowOuterWidth(); windowHeight = egw_getWindowOuterHeight(); @@ -116,12 +118,19 @@ function egw_openWindowCentered2(_url, _windowName, _width, _height, _status) ",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status="+_status); // returning something, replaces whole window in FF, if used in link as "javascript:egw_openWindowCentered2()" - //return windowID; + if (_returnID === false) + { + // return nothing + } + else + { + return windowID; + } } function egw_openWindowCentered(_url, _windowName, _width, _height) { - return egw_openWindowCentered2(_url, _windowName, _width, _height, 'no'); + return egw_openWindowCentered2(_url, _windowName, _width, _height, 'no', false, true); } // return the left position of the window