Browse Source

Show hide save button

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
6254fed1fc
  1. 1
      edit-mode/function/function.js
  2. 13
      edit-mode/function/restActivityLink.js

1
edit-mode/function/function.js

@ -677,6 +677,7 @@ function batchUpdate(){
}).then(function (response) { }).then(function (response) {
$("body").removeClass("loading"); $("body").removeClass("loading");
localStorage.setItem('batchEntity', ''); localStorage.setItem('batchEntity', '');
$("#save-activity").hide();
sendStorage(); sendStorage();
refresData(); refresData();
}).catch(function (error) { }).catch(function (error) {

13
edit-mode/function/restActivityLink.js

@ -10,6 +10,12 @@ gantt.ajax.get({
} }
}).then(function (xhr) { }).then(function (xhr) {
$("body").removeClass("loading"); $("body").removeClass("loading");
let batchEntity = localStorage.getItem('batchEntity');
if (!batchEntity || batchEntity == '') {
$("#save-activity").hide();
} else {
$("#save-activity").show();
}
let data = {}; let data = {};
let response = xhr.responseText; let response = xhr.responseText;
let obj = JSON.parse(response); let obj = JSON.parse(response);
@ -64,6 +70,12 @@ function refresData(id) {
} }
}).then(function (xhr) { }).then(function (xhr) {
$("body").removeClass("loading"); $("body").removeClass("loading");
let batchEntity = localStorage.getItem('batchEntity');
if (!batchEntity || batchEntity == '') {
$("#save-activity").hide();
} else {
$("#save-activity").show();
}
gantt.clearAll(); gantt.clearAll();
let data = {}; let data = {};
let response = xhr.responseText; let response = xhr.responseText;
@ -198,6 +210,7 @@ var dp = gantt.createDataProcessor(function (entity, action, data, id) {
toBeSet = [batchEntity] toBeSet = [batchEntity]
} }
localStorage.setItem('batchEntity', JSON.stringify(toBeSet)); localStorage.setItem('batchEntity', JSON.stringify(toBeSet));
$("#save-activity").show();
sendStorage(); sendStorage();
// $("body").addClass("loading"); // $("body").addClass("loading");
// return gantt.ajax.put({ // return gantt.ajax.put({

Loading…
Cancel
Save