I am developing a collaborative Kanban for a couple of users and I have a capability of remove items from a board. In that, I call jkanban.removeElement(elementId) to remove a card from current Kanban in order to add at another Kanban (like "Move" of Trello). The problem is when I call jkanban.remove() when the item is not there, jKanban raises a "el is null" error because of:
this.removeElement = function (el) {
if (typeof(el) === 'string')
el = self.element.querySelector('[data-eid="' + el + '"]');
el.remove(); //<--- here
return self;
};
I suggest to add a validation for removeLike methods to verify if element actually exists:
this.removeElement = function (el) {
if (typeof(el) === 'string')
el = self.element.querySelector('[data-eid="' + el + '"]');
if (el !== null)
el.remove();
return self;
};
I am developing a collaborative Kanban for a couple of users and I have a capability of remove items from a board. In that, I call jkanban.removeElement(elementId) to remove a card from current Kanban in order to add at another Kanban (like "Move" of Trello). The problem is when I call jkanban.remove() when the item is not there, jKanban raises a "el is null" error because of:
I suggest to add a validation for removeLike methods to verify if element actually exists: