mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Clicking the notification focuses the tab
This commit is contained in:
@@ -140,7 +140,7 @@ $(document).ready(function()
|
||||
+ ": " + git_info[0].commit.author.name
|
||||
+ "<br><a href='"+git_info[0].html_url+"'>"
|
||||
+ git_info[0].sha.substring(0,10) + "</a>: "
|
||||
+ git_info[0].commit.message+"<br");
|
||||
+ git_info[0].commit.message+"<br");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -283,7 +283,8 @@ function notifyUser(id, title) {
|
||||
title= title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
|
||||
if (Notification.permission === "granted" && document.hidden && id != "30H2Z8Lr-4c" && !window.mobilecheck()) {
|
||||
var notification = new Notification("Now Playing", {body: title, icon: "http://i.ytimg.com/vi/"+id+"/mqdefault.jpg", iconUrl: "http://i.ytimg.com/vi/"+id+"/mqdefault.jpg"});
|
||||
setTimeout(function(){
|
||||
notification.onclick = function(x) { window.focus(); this.cancel(); };
|
||||
setTimeout(function(){
|
||||
notification.close();
|
||||
},5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user