From f556ea8a2c4409b170775c7ef46a8a5976980ee8 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 28 Nov 2016 14:16:34 +0800 Subject: webui: Use the same "#modal-box" and the "showModal()" function --- fg21sim/webui/static/js/main.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'fg21sim/webui/static/js/main.js') 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 = $("

"); -- cgit v1.2.2