Skip to content

Commit

Permalink
Merge 0426c19 into 3675d7c
Browse files Browse the repository at this point in the history
  • Loading branch information
GhaziTriki committed Sep 20, 2016
2 parents 3675d7c + 0426c19 commit 32bd720
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Backend/Modules/FormBuilder/Js/FormBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ jsBackend.FormBuilder.Fields =
paramsSave: '',
paramsSequence: '',

/**
* Is set to true while an edit AJAX request has been sent to server
*/
lockEditRequest: false,

/**
* Initialization
*/
Expand Down Expand Up @@ -329,6 +334,14 @@ jsBackend.FormBuilder.Fields =
// prevent default
e.preventDefault();

// checking if a request has been sent to load field that needs to be edited
if (jsBackend.FormBuilder.Fields.lockEditRequest) {
return;
}

// else we lock editing and continue processing the request
jsBackend.FormBuilder.Fields.lockEditRequest = true;

// get id
var id = $(this).attr('rel');

Expand Down Expand Up @@ -570,6 +583,9 @@ jsBackend.FormBuilder.Fields =
if (data.code != 200 && jsBackend.debug) {
alert(data.message);
}

// unlocks editing whatever server response is
jsBackend.FormBuilder.Fields.lockEditRequest = false;
}
});
}
Expand Down

0 comments on commit 32bd720

Please sign in to comment.