diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index ef8cece435..0f6da51e5c 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -141,7 +141,7 @@ var AppJS = Class.extend( } this.et2 = et2.widgetContainer; this._fix_iFrameScrolling(); - if (this.egw.is_popup()) this._set_Window_title(); + if (this.egw && this.egw.is_popup()) this._set_Window_title(); }, /** diff --git a/phpgwapi/js/jsapi/egw_open.js b/phpgwapi/js/jsapi/egw_open.js index 5097c72c5c..19fc4a6007 100644 --- a/phpgwapi/js/jsapi/egw_open.js +++ b/phpgwapi/js/jsapi/egw_open.js @@ -71,9 +71,15 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) if (uri.length > 2083) { popup = egw.open('','mail','add','','compose__','mail'); - // Build a temp Form and submit right away - var $tmpForm = jQuery('
').appendTo('body').submit(); + var $tmpForm = jQuery(document.createElement('form')).appendTo('body'); + var $tmpInput = jQuery(document.createElement('input')).attr({name:"preset[mailto]", type:"text", value: uri}); + var $tmpSubmitInput = jQuery(document.createElement('input')).attr({type:"submit"}); + // Set the temporary form's attributes + $tmpForm.attr({target:popup.name, action:"index.php?menuaction=mail.mail_compose.compose", method:"post"}) + .append($tmpInput) + .append($tmpSubmitInput); + $tmpForm.submit(); + // Remove the form after submit $tmpForm.remove(); } else // simple GET request