From 036643197503dd9ec4ed06f69beacfb0fbd22f7c Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Tue, 6 Sep 2022 16:39:30 +0200
Subject: [PATCH] [Bands] Added message saying that band has been saved.
---
application/views/bands/index.php | 2 +-
assets/js/sections/bands.js | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/application/views/bands/index.php b/application/views/bands/index.php
index a7233c62..a705701f 100644
--- a/application/views/bands/index.php
+++ b/application/views/bands/index.php
@@ -64,7 +64,7 @@
Delete
- Save
+ Save
|
diff --git a/assets/js/sections/bands.js b/assets/js/sections/bands.js
index 86009e0b..91424736 100644
--- a/assets/js/sections/bands.js
+++ b/assets/js/sections/bands.js
@@ -141,6 +141,8 @@ function deactivateAllBands() {
}
function saveBand(id) {
+ $(".btnband_"+id).addClass('running');
+ $(".btnband_"+id).prop('disabled', true);
$.ajax({
url: base_url + 'index.php/band/saveBand',
type: 'post',
@@ -157,7 +159,10 @@ function saveBand(id) {
'vucc': $(".vucc_"+id+" input[type='checkbox']").is(":checked")
},
success: function (html) {
- // Add an alert to say that it is saved. Vanish after 5 seconds.
+ $(".alert").remove();
+ $('.card-body').prepend('×'+$(".band_"+id).parent("tr:first").find("td:first").text()+' band has been saved!
');
+ $(".btnband_"+id).removeClass('running');
+ $(".btnband_"+id).prop('disabled', false);
}
});
}
\ No newline at end of file