aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/main.js
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-28 14:16:34 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-28 14:16:34 +0800
commitf556ea8a2c4409b170775c7ef46a8a5976980ee8 (patch)
treef653a4069a63760c98ec5096fc1a6f1a0910580d /fg21sim/webui/static/js/main.js
parentf766c58aabfa35678f2a0a1e5163ff8b3c6129de (diff)
downloadfg21sim-f556ea8a2c4409b170775c7ef46a8a5976980ee8.tar.bz2
webui: Use the same "#modal-box" and the "showModal()" function
Diffstat (limited to 'fg21sim/webui/static/js/main.js')
-rw-r--r--fg21sim/webui/static/js/main.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/fg21sim/webui/static/js/main.js b/fg21sim/webui/static/js/main.js
index 58e6040..71310e4 100644
--- a/fg21sim/webui/static/js/main.js
+++ b/fg21sim/webui/static/js/main.js
@@ -188,9 +188,6 @@ var toggleBlock = function (toggle, targetBlock) {
/**
* Compose the notification contents and shown them in the modal box.
*
- * The input `modalBox` may be a jQuery object or a jQuery selector of the
- * target modal box.
- *
* The input `data` may have the following attributes:
* - `icon` : FontAwesome icon (specified without the beginning `fa-`)
* - `title` : Notification title/summary
@@ -203,9 +200,11 @@ var toggleBlock = function (toggle, targetBlock) {
* + `click` : {Function} Function called on click.
* To close the modal, use `$.modal.close()`
*/
-var showModal = function (modalBox, data) {
+var showModal = function (data, box) {
+ var modalBox = typeof box !== "undefined"
+ ? $(modalBox)
+ : $("#modal-box");
var p;
- modalBox = $(modalBox);
// Empty previous contents
modalBox.html("");
p = $("<p>");