no confirmation dialog for empty annotations
This commit is contained in:
parent
01596fa174
commit
6e1e2be9c4
1 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue