fix error caused by browser popup blocker and display popup blocked warning for quick-add selectbox

This commit is contained in:
Ralf Becker 2015-03-18 10:36:47 +00:00
parent 3f5a251ad6
commit b1e5fac775
2 changed files with 6 additions and 4 deletions

View File

@ -447,7 +447,7 @@ egw.extend('links', egw.MODULE_GLOBAL, function()
var self = this; var self = this;
// bind change handler // bind change handler
select.change(function(){ select.change(function(){
if (this.value) self.open('', this.value, 'add', {}, undefined, this.value); if (this.value) self.open('', this.value, 'add', {}, undefined, this.value, true);
this.value = ''; this.value = '';
}); });
// need to load common translations for app-names // need to load common translations for app-names

View File

@ -128,9 +128,11 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
* @param {object|string} extra extra url parameters to append as object or string * @param {object|string} extra extra url parameters to append as object or string
* @param {string} target target of window to open * @param {string} target target of window to open
* @param {string} target_app target application to open in that tab * @param {string} target_app target application to open in that tab
* @param {boolean} _check_popup_blocker TRUE check if browser pop-up blocker is on/off, FALSE no check
* - This option only makes sense to be enabled when the open_link requested without user interaction
* @memberOf egw * @memberOf egw
*/ */
open: function(id_data, app, type, extra, target, target_app) open: function(id_data, app, type, extra, target, target_app, _check_popup_blocker)
{ {
// Log for debugging purposes - special log tag 'navigation' always // Log for debugging purposes - special log tag 'navigation' always
// goes in user log, if user log is enabled // goes in user log, if user log is enabled
@ -229,7 +231,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
} }
popup = app_registry[type+'_popup']; popup = app_registry[type+'_popup'];
} }
return this.open_link(this.link(url, params), target, popup, target_app); return this.open_link(this.link(url, params), target, popup, target_app, _check_popup_blocker);
}, },
/** /**
@ -343,7 +345,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status="+_status); ",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status="+_status);
// inject egw object // inject egw object
windowID.egw = _wnd.egw; if (windowID) windowID.egw = _wnd.egw;
// returning something, replaces whole window in FF, if used in link as "javascript:egw_openWindowCentered2()" // returning something, replaces whole window in FF, if used in link as "javascript:egw_openWindowCentered2()"
if (_returnID !== false) return windowID; if (_returnID !== false) return windowID;