mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-26 18:03:39 +01:00
Return an object for egw message in order to have access to it after display
This commit is contained in:
parent
9c63ee5d23
commit
e120bdb189
@ -173,8 +173,6 @@ class admin_hooks
|
||||
}
|
||||
// allow apps to hook into "Admin >> Clear cache and register hooks"
|
||||
Api\Hooks::process('clear_cache', array(), true);
|
||||
|
||||
Api\Json\Response::get()->apply('egw.message', array(lang('Done'), 'success'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1101,9 +1101,13 @@ var AdminApp = /** @class */ (function (_super) {
|
||||
* cache to use different method not requiring eg. so much memory
|
||||
*/
|
||||
AdminApp.prototype.clear_cache = function () {
|
||||
this.egw.message(this.egw.lang('Clear cache and register hooks') + "\n" + this.egw.lang('Please wait...'), 'info');
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache').sendRequest(true, undefined, jQuery.proxy(function (_xmlhttp, _err) {
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1').sendRequest(true);
|
||||
var wait = this.egw.message(this.egw.lang('Clear cache and register hooks') + "\n" + this.egw.lang('Please wait...'), 'info');
|
||||
var success = function () {
|
||||
wait.close();
|
||||
egw.message('Done');
|
||||
};
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache', null, success).sendRequest(true, undefined, jQuery.proxy(function (_xmlhttp, _err) {
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1', null, success).sendRequest(true);
|
||||
}, this));
|
||||
};
|
||||
/**
|
||||
|
@ -1335,11 +1335,14 @@ class AdminApp extends EgwApp
|
||||
*/
|
||||
clear_cache()
|
||||
{
|
||||
this.egw.message(this.egw.lang('Clear cache and register hooks')+"\n"+this.egw.lang('Please wait...'),'info');
|
||||
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache').sendRequest(true, undefined, jQuery.proxy(function(_xmlhttp, _err)
|
||||
let wait = this.egw.message(this.egw.lang('Clear cache and register hooks')+"\n"+this.egw.lang('Please wait...'),'info');
|
||||
let success = function (){
|
||||
wait.close();
|
||||
egw.message('Done');
|
||||
};
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache', null, success).sendRequest(true, undefined, jQuery.proxy(function(_xmlhttp, _err)
|
||||
{
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1').sendRequest(true);
|
||||
this.egw.json('admin.admin_hooks.ajax_clear_cache&errored=1', null, success).sendRequest(true);
|
||||
}, this));
|
||||
}
|
||||
|
||||
|
4
api/js/jsapi/egw_global.d.ts
vendored
4
api/js/jsapi/egw_global.d.ts
vendored
@ -827,8 +827,10 @@ declare interface IegwWndLocal extends IegwGlobal
|
||||
* @param {string} _discardID unique string id (appname:id) in order to register
|
||||
* the message as discardable. If no appname given, the id will be prefixed with
|
||||
* current app. The discardID will be stored in local storage.
|
||||
*
|
||||
* @returns {object} returns an object containing data and methods related to the message
|
||||
*/
|
||||
message(_msg : string, _type? : "help"|"info"|"error"|"warning"|"success", _discardID? : string) : void;
|
||||
message(_msg: string, _type?: "help" | "info" | "error" | "warning" | "success", _discardID?: string): {node: JQuery, message: string, index: number, close: Function};
|
||||
/**
|
||||
* Are we running in a popup
|
||||
*
|
||||
|
@ -62,6 +62,8 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
* @param {string} _discardID unique string id (appname:id) in order to register
|
||||
* the message as discardable. If no appname given, the id will be prefixed with
|
||||
* current app. The discardID will be stored in local storage.
|
||||
*
|
||||
* @return {object} returns an object containing data and methods related to the message
|
||||
*/
|
||||
message: function(_msg, _type, _discardID)
|
||||
{
|
||||
@ -206,6 +208,12 @@ egw.extend('message', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
return {
|
||||
node: msg_div,
|
||||
message: _msg,
|
||||
index: msg_index,
|
||||
close: function(){msg_close.click();}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user