Remove _targetapp argument from observer and add _links. Additionally, make sure if the application, fired observer, is linked and needs to be refreshed

This commit is contained in:
Hadi Nategh 2014-05-26 14:01:18 +00:00
parent 086501bc30
commit d58b111165
2 changed files with 16 additions and 11 deletions

View File

@ -79,9 +79,12 @@ app.classes.infolog = AppJS.extend(
* - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: requires full reload for proper sorting
* @param {string} _msg_type 'error', 'warning' or 'success' (default)
* @param {string} _targetapp which app's window should be refreshed, default current
* @param {object|null} _links app => array of ids of linked entries
* or null, if not triggered on server-side, which adds that info
*/
observer: function(_msg, _app, _id, _type, _msg_type, _targetapp)
observer: function(_msg, _app, _id, _type, _msg_type, _links)
{
if (typeof _links['infolog'] != 'undefined')
{
switch (_app)
{
@ -90,6 +93,7 @@ app.classes.infolog = AppJS.extend(
if (nm) nm.applyFilters();
break;
}
}
},
/**

View File

@ -173,10 +173,11 @@ app.classes.mail = AppJS.extend(
* - delete: just delete the given rows clientside (no server interaction neccessary)
* - add: requires full reload for proper sorting
* @param {string} _msg_type 'error', 'warning' or 'success' (default)
* @param {string} _targetapp which app's window should be refreshed, default current
* @param {object|null} _links app => array of ids of linked entries
* or null, if not triggered on server-side, which adds that info
* @return {false|*} false to stop regular refresh, thought all observers are run
*/
observer: function(_msg, _app, _id, _type, _msg_type, _targetapp)
observer: function(_msg, _app, _id, _type, _msg_type, _links)
{
switch(_app)
{