[Git][noosfero/noosfero][master] 2 commits: notification: make permanent notification throught requireInteraction property
Rodrigo Souto
gitlab at mg.gitlab.com
Wed Feb 8 17:13:24 BRST 2017
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
59d214d2 by Rodrigo Souto at 2017-01-24T14:45:42-03:00
notification: make permanent notification throught requireInteraction property
Already works on Chromium and will be available on Firefox on version
52.
https://developer.mozilla.org/en-US/Firefox/Releases/52#DOM_HTML_DOM
- - - - -
c70f172d by Rodrigo Souto at 2017-02-08T19:13:14+00:00
Merge branch 'permanent-notification' into 'master'
notification: make permanent notification through requireInteraction property
See merge request !1100
- - - - -
1 changed file:
- public/javascripts/application.js
Changes:
=====================================
public/javascripts/application.js
=====================================
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1136,6 +1136,9 @@ function notifyMe(title, options) {
return null;
}
+ if(PERMANENT_NOTIFICATIONS)
+ options.requireInteraction = true
+
// Let's check if the user is okay to get some notification
var notification = null;
if (Notification.permission === "granted") {
@@ -1160,15 +1163,11 @@ function notifyMe(title, options) {
});
}
- if(!PERMANENT_NOTIFICATIONS)
- setTimeout(function() {notification.close()}, 5000);
-
notification.onclick = function(){
notification.close();
// Chromium tweak
window.open().close();
window.focus();
- this.cancel();
};
return notification;
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/e19703d87266c44cc940479067f8cee7d0bd19de...c70f172d1305a49d042498fbcc59640763ed4b01
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170208/d9c3fbed/attachment-0001.html>
More information about the Noosfero-dev
mailing list