angular-gridster2
angular-gridster2 copied to clipboard
Is there any way to handle when auto position item fails?
I'm looking at autoPositionItem():
autoPositionItem(itemComponent) {
if (this.getNextPossiblePosition(itemComponent.$item)) {
// yada yada
}
else {
itemComponent.notPlaced = true;
if (!this.$options.disableWarnings) {
console.warn('Can\'t be placed in the bounds of the dashboard!/n' +
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y']));
}
}
}
The default behavior as it its now works great, I don't mind it auto position the items for me. But when user adds more item and it fails, I would like to be able to handle it - like show an alert or something.
I can hack around to detect console.warn, but I also would like to disable the warnings at production, so I can't detect the console.warn then.