Focus the tab when clicking on a notification
This commit is contained in:
parent
50d0abd193
commit
d9e7fc24fe
@ -30,10 +30,19 @@ define(['/api/config'], function (ApiConfig) {
|
|||||||
icon = DEFAULT_ALT;
|
icon = DEFAULT_ALT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Notification(title,{
|
var n = new Notification(title,{
|
||||||
icon: icon,
|
icon: icon,
|
||||||
body: msg,
|
body: msg,
|
||||||
});
|
});
|
||||||
|
n.onclick = function () {
|
||||||
|
if (!document) { return; }
|
||||||
|
try {
|
||||||
|
parent.focus();
|
||||||
|
window.focus(); //just in case, older browsers
|
||||||
|
this.close();
|
||||||
|
} catch (e) {}
|
||||||
|
};
|
||||||
|
return n;
|
||||||
};
|
};
|
||||||
|
|
||||||
Module.system = function (msg, title, icon) {
|
Module.system = function (msg, title, icon) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user