Catch undefined Notification for IE

Notification is not defined on IE.
Also it is better to put javascript in the js files.

issue7683
review54341002
This commit is contained in:
Cédric Krier
2018-09-11 00:16:13 +02:00
parent 4f9d43bde4
commit 7ea5b47630
3 changed files with 12 additions and 3 deletions
-2
View File
@@ -93,8 +93,6 @@ this repository contains the full copyright notices and license terms. -->
}
}
});
Notification.requestPermission();
Sao.login();
});
</script>
</body>
+6 -1
View File
@@ -59,7 +59,12 @@
Sao.Bus.handle = function(message) {
var notify = function(message) {
if (Notification.permission != "granted") {
try {
if (Notification.permission != "granted") {
return;
}
} catch (e) {
(console.error || console.log).call(console, e, e.stack);
return;
}
+6
View File
@@ -1003,6 +1003,12 @@ var Sao = {};
jQuery(document).ready(function() {
set_shortcuts();
try {
Notification.requestPermission();
} catch (e) {
(console.error || console.log).call(console, e, e.stack);
}
Sao.login();
});
function set_shortcuts() {