|
@@ -76,9 +76,17 @@
|
|
|
|
|
|
showMask();
|
|
|
|
|
|
+ let closeOnSave = false, noteSection = form.closest('.note-section');
|
|
|
+ if($(this).closest('[visit-moe]').is('[close-on-save]')) {
|
|
|
+ closeOnSave = true;
|
|
|
+ }
|
|
|
+
|
|
|
$.post(form.attr('url'), form.serialize(), _data => {
|
|
|
hideMask();
|
|
|
updateAllSegmentsInResponse(_data);
|
|
|
+ if(closeOnSave) {
|
|
|
+ noteSection.removeClass('edit');
|
|
|
+ }
|
|
|
}, 'json');
|
|
|
return false;
|
|
|
});
|
|
@@ -98,6 +106,9 @@
|
|
|
.off('click.visit-moe-cancel')
|
|
|
.on('click.visit-moe-cancel', function() {
|
|
|
$(this).closest('[visit-moe]').find('[url]:not([show])').hide();
|
|
|
+ if($(this).closest('[visit-moe]').is('[close-on-cancel]')) {
|
|
|
+ $(this).closest('.note-section').removeClass('edit');
|
|
|
+ }
|
|
|
return false;
|
|
|
});
|
|
|
}
|