diff options
Diffstat (limited to 'js/wwwsqldesigner.js')
-rw-r--r-- | js/wwwsqldesigner.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js index 5026af8..1ec115f 100644 --- a/js/wwwsqldesigner.js +++ b/js/wwwsqldesigner.js @@ -1348,6 +1348,7 @@ SQL.TableManager.prototype.init = function(owner) { OZ.Event.add(this.dom.aligntables, "click", this.owner.bind(this.owner.alignTables)); OZ.Event.add(this.dom.edittable, "click", this.bind(this.edit)); OZ.Event.add(this.dom.tablekeys, "click", this.bind(this.keys)); + OZ.Event.add(document, "keydown", this.bind(this.press)); this.dom.container.parentNode.removeChild(this.dom.container); } @@ -1455,6 +1456,18 @@ SQL.TableManager.prototype.save = function() { this.selected.setComment(this.dom.comment.value); } +SQL.TableManager.prototype.press = function(e) { + if (!this.selected) { return; } + /* do not process keypresses if a row is selected */ + if (this.owner.rowManager.selected) { return; } + switch (e.keyCode) { + case 46: + this.remove(); + OZ.Event.prevent(e); + break; + } +} + /* --------------------- row manager ------------ */ SQL.RowManager = OZ.Class(); @@ -1626,6 +1639,10 @@ SQL.RowManager.prototype.press = function(e) { this.down(); OZ.Event.prevent(e); break; + case 46: + this.remove(); + OZ.Event.prevent(e); + break; case 13: case 27: this.selected.collapse(); |