diff --git a/phpgwapi/js/framework/fw_base.js b/phpgwapi/js/framework/fw_base.js index 4c362a1748..55d5268fe5 100644 --- a/phpgwapi/js/framework/fw_base.js +++ b/phpgwapi/js/framework/fw_base.js @@ -830,35 +830,6 @@ var fw_base = Class.extend({ return framework.activeApp.appName; }, - /** - * Display an error or regular message - * - * @param {string} _msg message to show - * @param {string} _type 'error', 'warning' or 'success' (default) - */ - setMessage: function(_msg, _type) - { - if (typeof _type == 'undefined') - _type = _msg.match(/error/i) ? 'error' : 'success'; - - if (this.messageTimer) - { - window.clearTimeout(this.messageTimer); - delete this.messageTimer; - } - - this.tabsUi.setAppHeader(_msg, _type+'_message'); - this.resizeHandler(); - - if (_type != 'error') // clear message again after some time, if no error - { - var self = this; - this.messageTimer = window.setTimeout(function() { - self.refreshAppTitle.call(self); - }, 5000); - } - }, - /** * Change timezone and refresh current app * @param _tz diff --git a/phpgwapi/js/jsapi/egw_message.js b/phpgwapi/js/jsapi/egw_message.js index f9e313f7df..a97281e04f 100644 --- a/phpgwapi/js/jsapi/egw_message.js +++ b/phpgwapi/js/jsapi/egw_message.js @@ -27,7 +27,6 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) _app; // not used, but required by function signature var message_timer; var error_reg_exp; - var on_click_remove_installed = false; var a_href_reg = /([^<]+)<\/a>/img; var new_line_reg = /<\/?(p|br)\s*\/?>\n?/ig; @@ -63,7 +62,6 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) */ message: function(_msg, _type) { - var framework = _wnd.framework; var jQuery = _wnd.jQuery; if (_msg && !_type) @@ -73,17 +71,6 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) _type = _msg.match(error_reg_exp) ? 'error' : 'success'; } - // if we are NOT in a popup and have a framwork --> let it deal with it - if (!this.is_popup() && typeof framework != 'undefined') - { - // currently not using framework, but top windows message - //framework.setMessage.call(framework, _msg, _type); - if (_wnd !== _wnd.top) - { - egw(_wnd.top).message(_msg, _type); - return; - } - } // handle message display for non-framework templates, eg. idots or jerryr if (message_timer) { @@ -100,14 +87,6 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) if (_msg) // empty _msg just removes pervious message { - if (!on_click_remove_installed) - { - // install handler to remove message on click - jQuery('body').on('click', 'div#egw_message', function(e) { - jQuery('div#egw_message').remove(); - }); - on_click_remove_installed = true; - } // replace p and br-tags with newlines _msg = _msg.replace(new_line_reg, "\n"); @@ -115,6 +94,7 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd) .attr('id','egw_message') .text(_msg) .addClass(_type+'_message') + .click(function() {this.remove();}) .css('position', 'absolute'); parent.prepend(msg_div);