diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-11-17 10:41:36 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-11-17 10:41:36 +0800 |
commit | f34766376b6a77b740f2d218de901062b6de4cf6 (patch) | |
tree | 2c1030dfcc9506b7789209462eece598496bad61 /fg21sim/webui | |
parent | 3898a31047c218c43959593bbe738a1424882aa8 (diff) | |
download | fg21sim-f34766376b6a77b740f2d218de901062b6de4cf6.tar.bz2 |
webui: configs.js: Confirm before reset the configurations
Diffstat (limited to 'fg21sim/webui')
-rw-r--r-- | fg21sim/webui/static/js/configs.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/fg21sim/webui/static/js/configs.js b/fg21sim/webui/static/js/configs.js index 80c218c..4b01ca3 100644 --- a/fg21sim/webui/static/js/configs.js +++ b/fg21sim/webui/static/js/configs.js @@ -549,8 +549,26 @@ $(document).ready(function () { // Reset both server-side and client-side configurations to the defaults $("#reset-defaults").on("click", function () { - // TODO: add a confirmation dialog - resetConfigs(ajax_url); + var modalData = {}; + modalData.icon = "warning"; + modalData.message = ("Are you sure to reset the configurations?"); + modalData.buttons = [ + { + text: "Cancel", + rel: "modal:close", + click: function () { $.modal.close(); } + }, + { + text: "Reset!", + "class": "button-warning", + rel: "modal:close", + click: function () { + $.modal.close(); + resetConfigs(ajax_url); + } + }, + ]; + showConfigsModal(modalData); }); // Load the configurations from the specified user configuration file |