Ability to remove an object when draw mode is off
This commit is contained in:
parent
a13261abaa
commit
be1db2a1ec
@ -155,6 +155,22 @@ define([
|
||||
};
|
||||
$toggle.click(toggleDrawMode);
|
||||
|
||||
$(window).on('keyup', function (e) {
|
||||
if (e.which === 46) {
|
||||
if (canvas.getActiveObject()) {
|
||||
canvas.getActiveObject().remove();
|
||||
}
|
||||
if (canvas.getActiveGroup()) {
|
||||
canvas.getActiveGroup()._objects.forEach(function (el) {
|
||||
el.remove();
|
||||
});
|
||||
canvas.discardActiveGroup();
|
||||
}
|
||||
canvas.renderAll();
|
||||
onLocal();
|
||||
}
|
||||
});
|
||||
|
||||
var setEditable = function (bool) {
|
||||
if (readOnly && bool) { return; }
|
||||
if (bool) { $controls.show(); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user