Replace more modals with Toast
This commit is contained in:
parent
79f59de92e
commit
d7bc3e500b
|
@ -153,23 +153,23 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
// console.log("delete : " + data);
|
// console.log("delete : " + data);
|
||||||
if (dev_cmd != '') {
|
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({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: 'ajax.php?module=sccp_manager&command=' + dev_cmd,
|
url: 'ajax.php?module=sccp_manager&command=' + dev_cmd,
|
||||||
command: dev_cmd,
|
command: dev_cmd,
|
||||||
data: ext_data,
|
data: ext_data,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
// console.log(data);
|
|
||||||
if (data.status === true) {
|
if (data.status === true) {
|
||||||
if (data.message) {
|
|
||||||
var old_style = bs_alert(data.message, data.status, data.reload);
|
|
||||||
}
|
|
||||||
if (data.table_reload === true) {
|
if (data.table_reload === true) {
|
||||||
$('table').bootstrapTable('refresh');
|
$('table').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
if (data.reload === true && old_style === true ) {
|
if (data.message) {
|
||||||
location.reload();
|
fpbxToast(data.message,_('Operation Result'), 'success');
|
||||||
|
if (data.reload === true) {
|
||||||
|
//Need setTimout or reload will kill Toast
|
||||||
|
setTimeout(function(){location.reload();},500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bs_alert(data.message,data.status);
|
bs_alert(data.message,data.status);
|
||||||
|
@ -628,7 +628,6 @@ $(document).ready(function () {
|
||||||
if (Array.isArray(data.message)) {
|
if (Array.isArray(data.message)) {
|
||||||
data.message.forEach(function (entry) {
|
data.message.forEach(function (entry) {
|
||||||
bs_alert(entry,data.status);
|
bs_alert(entry,data.status);
|
||||||
//fpbxToast(entry, 'error', 'error');
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (data.message) {
|
if (data.message) {
|
||||||
|
|
Loading…
Reference in a new issue