Browse Source

Send storage to parent

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
727cbfd8a9
  1. 8
      edit-mode/function/function.js
  2. 1
      edit-mode/function/restActivityLink.js

8
edit-mode/function/function.js

@ -677,6 +677,7 @@ function batchUpdate(){
}).then(function (response) {
$("body").removeClass("loading");
localStorage.setItem('batchEntity', '');
sendStorage();
refresData();
}).catch(function (error) {
$("body").removeClass("loading")
@ -691,11 +692,14 @@ function batchUpdate(){
$(window).on('beforeunload', function(event) {
let batchEntity = localStorage.getItem('batchEntity');
sendStorage();
if (batchEntity && batchEntity != '') {
event.preventDefault()
return event.returnValue = 'You have unsaved changes. Are you sure you want to leave this page?';
}
});
const batchEntityData = localStorage.getItem('batchEntity');
window.parent.postMessage({ batchEntity: batchEntityData }, '*');
function sendStorage(){
const batchEntityData = localStorage.getItem('batchEntity');
window.parent.postMessage({ batchEntity: batchEntityData }, '*');
}

1
edit-mode/function/restActivityLink.js

@ -198,6 +198,7 @@ var dp = gantt.createDataProcessor(function (entity, action, data, id) {
toBeSet = [batchEntity]
}
localStorage.setItem('batchEntity', JSON.stringify(toBeSet));
sendStorage();
// $("body").addClass("loading");
// return gantt.ajax.put({
// headers: {

Loading…
Cancel
Save