From 6e1e2be9c41dd75e9acfc5acaf300327b3944b19 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 30 Jan 2025 16:59:35 +0530 Subject: [PATCH] no confirmation dialog for empty annotations --- source/UI/js/Form/ArrayEditable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/UI/js/Form/ArrayEditable.js b/source/UI/js/Form/ArrayEditable.js index 7a1a0637..11f62ff9 100644 --- a/source/UI/js/Form/ArrayEditable.js +++ b/source/UI/js/Form/ArrayEditable.js @@ -117,12 +117,12 @@ Ox.ArrayEditable = function(options, self) { self.selected = getSelectedPosition(); - function deleteItem(id) { + function deleteItem(id, empty) { // it is possible to delete an (empty-value) item // by selecting another one id = id || self.options.selected; - (self.options.confirmDeleteDialog ? self.options.confirmDeleteDialog: Ox.noop)({ + (self.options.confirmDeleteDialog && !empty ? self.options.confirmDeleteDialog: Ox.noop)({ items: Ox.isArray(id) ? id : [id], }, function(result) { if (self.options.editable) { @@ -437,7 +437,7 @@ Ox.ArrayEditable = function(options, self) { var item = Ox.getObjectById(self.options.items, id); Ox.Log('AE', 'submitItem', id, item) if (value === '') { - deleteItem(item.id); + deleteItem(item.id, true); } else { that.triggerEvent(item.value === value ? 'blur' : 'submit', { id: item.id,