From d7bc3e500bf98c5558ad920bf3bde441515893ae Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Mon, 14 Jun 2021 14:24:11 +0200 Subject: [PATCH] Replace more modals with Toast --- assets/js/sccp_manager.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index e0d8dff..9f373e9 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -153,23 +153,23 @@ $(document).ready(function () { } // console.log("delete : " + data); if (dev_cmd != '') { - if (confirm(_('Are you sure you wish to delete "' + dev_id.toString().toUpperCase() + '" inormation ?'))) { + if (confirm(_('Are you sure you wish to delete "' + dev_id.toString().toUpperCase() + '" information?'))) { $.ajax({ type: 'POST', url: 'ajax.php?module=sccp_manager&command=' + dev_cmd, command: dev_cmd, data: ext_data, success: function (data) { -// console.log(data); if (data.status === true) { - if (data.message) { - var old_style = bs_alert(data.message, data.status, data.reload); - } if (data.table_reload === true) { $('table').bootstrapTable('refresh'); } - if (data.reload === true && old_style === true ) { - location.reload(); + if (data.message) { + fpbxToast(data.message,_('Operation Result'), 'success'); + if (data.reload === true) { + //Need setTimout or reload will kill Toast + setTimeout(function(){location.reload();},500); + } } } else { bs_alert(data.message,data.status); @@ -628,7 +628,6 @@ $(document).ready(function () { if (Array.isArray(data.message)) { data.message.forEach(function (entry) { bs_alert(entry,data.status); - //fpbxToast(entry, 'error', 'error'); }); } else { if (data.message) {