mirror of
https://github.com/myvesta/vesta
synced 2025-07-12 16:13:34 -07:00
Timezone warning / add entry no-reload
This commit is contained in:
parent
511703fa3e
commit
79699b83be
3 changed files with 16 additions and 10 deletions
|
@ -252,11 +252,19 @@ App.Actions.save_form = function(evt) {
|
|||
}
|
||||
|
||||
if (elm.attr('id') == App.Constants[elm_id]) { // NEW ITEM
|
||||
var values = App.Helpers.getFormValues(elm);
|
||||
if(App.Validate.form(values, $('#'+elm_id))) {
|
||||
App.Model.add(values, source);
|
||||
var form_id = App.Constants[App.Env.world + '_FORM_ID'];
|
||||
$('#'+form_id).remove();
|
||||
if ($('.b-new-entry').length > 1) {
|
||||
var confirmed = confirm('You were editing other entries and those changes will be discarded. Click cancel if you want to save updated entries before adding new one.');
|
||||
if (!confirmed) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
var values = App.Helpers.getFormValues(elm);
|
||||
if(App.Validate.form(values, $('#'+elm_id))) {
|
||||
App.Model.add(values, source);
|
||||
var form_id = App.Constants[App.Env.world + '_FORM_ID'];
|
||||
$('#'+form_id).remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // OLD ITEM, UPDATING IT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue