diff options
author | Devaev Maxim <[email protected]> | 2018-08-27 13:13:49 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-08-27 13:13:49 +0300 |
commit | a8773eab1e8f82a7bd862492e5520dcb9690a5e0 (patch) | |
tree | 77c8caeaf749073e26ef50e83c44b784312dd79b /kvmd/web/js/atx.js | |
parent | 47a077a3b7d7ccadf8a1adcd608ffe61ac5bf818 (diff) |
own modals - first implementation
Diffstat (limited to 'kvmd/web/js/atx.js')
-rw-r--r-- | kvmd/web/js/atx.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/kvmd/web/js/atx.js b/kvmd/web/js/atx.js index cb0163ed..7e047176 100644 --- a/kvmd/web/js/atx.js +++ b/kvmd/web/js/atx.js @@ -38,17 +38,19 @@ function Atx() { }; var __clickButton = function(button, timeout, confirm_msg) { - if (confirm(confirm_msg)) { - var http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() { - if (http.readyState === 4) { - if (http.status === 409) { - alert("Performing another ATX operation for other client, please try again later"); - } else if (http.status !== 200) { - alert("Click error:", http.responseText); + modal.confirm(confirm_msg).then(function(ok) { + if (ok) { + var http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() { + if (http.readyState === 4) { + if (http.status === 409) { + modal.error("Performing another ATX operation for other client.<br>Please try again later"); + } else if (http.status !== 200) { + modal.error("Click error:<br>", http.responseText); + } } - } - }, timeout); - } + }, timeout); + } + }); }; var __setButtonsBusy = function(busy) { |