refactoring

This commit is contained in:
Devaev Maxim
2018-11-14 06:08:07 +03:00
parent ff2ac423b2
commit c5544349d2
4 changed files with 17 additions and 9 deletions

13
web/js/bb.js Normal file
View File

@@ -0,0 +1,13 @@
function check_browser() {
if (
!window.navigator
|| window.navigator.userAgent.indexOf("MSIE ") > 0
|| window.navigator.userAgent.indexOf("Trident/") > 0
|| window.navigator.userAgent.indexOf("Edge/") > 0
) {
$("bad-browser-modal").style.visibility = "visible";
return false;
} else {
return true;
}
}

View File

@@ -1,14 +1,7 @@
var ui;
function main() {
if (
!window.navigator
|| window.navigator.userAgent.indexOf("MSIE ") > 0
|| window.navigator.userAgent.indexOf("Trident/") > 0
|| window.navigator.userAgent.indexOf("Edge/") > 0
) {
$("bad-browser-modal").style.visibility = "visible";
} else {
if (check_browser()) {
ui = new Ui();
tools.setOnClick($("show-about-button"), () => ui.showWindow($("about-window")));