From be05fc02554e6b6a42f03552abc6e35d7713b24b Mon Sep 17 00:00:00 2001 From: "ondrej.zara" Date: Thu, 8 Jan 2009 06:50:19 +0000 Subject: [PATCH] issues #2 and #3 --HG-- extra : convert_revision : svn%3Ab267cdba-c1da-11dd-874b-8bacd04a0a74/trunk%4025 --- js/wwwsqldesigner.js | 56 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js index 89e80cf..0e1783f 100644 --- a/js/wwwsqldesigner.js +++ b/js/wwwsqldesigner.js @@ -118,10 +118,11 @@ SQL.Row.prototype.setTitle = function(t) { SQL.Row.prototype.click = function(e) { /* clicked on row */ OZ.Event.stop(e); + this.dispatch("rowclick",this); this.owner.owner.rowManager.select(this); } -SQL.Row.prototype.dblclick = function(e) { /* clicked on row */ +SQL.Row.prototype.dblclick = function(e) { /* dblclicked on row */ OZ.Event.prevent(e); OZ.Event.stop(e); this.expand(); @@ -1414,8 +1415,9 @@ SQL.RowManager.prototype.init = function(owner) { this.dom = {}; this.selected = null; this.creating = false; + this.connecting = false; - var ids = ["editrow","removerow","uprow","downrow","foreigncreate"]; + var ids = ["editrow","removerow","uprow","downrow","foreigncreate","foreignconnect"]; for (var i=0;i=0;i--) { + var k = this.table.keys[i]; + if (!k.rows.length) { this.table.removeKey(k); } + } +} + SQL.KeyManager.prototype.sync = function(table) { /* sync content with given table */ this.table = table; this.dom.listlabel.innerHTML = _("keyslistlabel").replace(/%s/,table.getTitle()); @@ -1728,7 +1770,7 @@ SQL.KeyManager.prototype.right = function(e) { /* remove field from index */ SQL.KeyManager.prototype.open = function(table) { this.sync(table); - this.owner.window.open(_("tablekeys"),this.dom.container); + this.owner.window.open(_("tablekeys"),this.dom.container,this.purge); } /* --------------------- window ------------ */