Remove translatable text and blocking 'confirm' dialog from jkanban.js
This commit is contained in:
parent
0ab27427bc
commit
087e346685
@ -193,7 +193,24 @@ define([
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
addItemButton: true,
|
addItemButton: true,
|
||||||
boards: boards
|
boards: boards,
|
||||||
|
dragcancelEl: function (el, boardId) {
|
||||||
|
// XXX
|
||||||
|
var pos = kanban.findElementPosition(el);
|
||||||
|
UI.confirm("Are you sure...??", function (yes) {
|
||||||
|
if (!yes) { return; }
|
||||||
|
var board;
|
||||||
|
kanban.options.boards.some(function (b) {
|
||||||
|
if (b.id === boardId) {
|
||||||
|
return (board = b);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!board) { return; }
|
||||||
|
board.item.splice(pos, 1);
|
||||||
|
$(el).remove();
|
||||||
|
kanban.onChange();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var addBoardDefault = document.getElementById('kanban-addboard');
|
var addBoardDefault = document.getElementById('kanban-addboard');
|
||||||
|
|||||||
@ -59,6 +59,7 @@
|
|||||||
dragEl: function (el, source) {},
|
dragEl: function (el, source) {},
|
||||||
dragendEl: function (el) {},
|
dragendEl: function (el) {},
|
||||||
dropEl: function (el, target, source, sibling) {},
|
dropEl: function (el, target, source, sibling) {},
|
||||||
|
dragcancelEl: function (el, boardId) {},
|
||||||
dragBoard: function (el, source) {},
|
dragBoard: function (el, source) {},
|
||||||
dragendBoard: function (el) {},
|
dragendBoard: function (el) {},
|
||||||
dropBoard: function (el, target, source, sibling) {},
|
dropBoard: function (el, target, source, sibling) {},
|
||||||
@ -157,15 +158,9 @@
|
|||||||
})
|
})
|
||||||
.on('cancel', function (el, container, source) {
|
.on('cancel', function (el, container, source) {
|
||||||
console.log("In cancel");
|
console.log("In cancel");
|
||||||
if (confirm("Do you want to remove this item?")) {
|
// FIXME custom code
|
||||||
var board1 = self.options.boards.find(function (element) {
|
var boardId = source.parentNode.dataset.id;
|
||||||
return element.id == $(source.parentNode).attr("data-id");
|
self.options.dragcancelEl(el, boardId);
|
||||||
});
|
|
||||||
var pos1 = self.dragItemPos;
|
|
||||||
board1.item.splice(pos1, 1);
|
|
||||||
$(el).remove();
|
|
||||||
self.onChange();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.on('drop', function (el, target, source, sibling) {
|
.on('drop', function (el, target, source, sibling) {
|
||||||
console.log("In drop");
|
console.log("In drop");
|
||||||
@ -1549,4 +1544,4 @@
|
|||||||
|
|
||||||
module.exports = tick;
|
module.exports = tick;
|
||||||
}, {}]
|
}, {}]
|
||||||
}, {}, [1]);
|
}, {}, [1]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user