From c0f40507acd8e958c482c4b1a6e2ba8b10061f64 Mon Sep 17 00:00:00 2001 From: "ondrej.zara" Date: Fri, 24 Apr 2009 08:32:58 +0000 Subject: [PATCH] ie6 fixes, table name autoselection (fixes issue #14) --HG-- extra : convert_revision : svn%3Ab267cdba-c1da-11dd-874b-8bacd04a0a74/trunk%4038 --- index.html | 3 ++- js/wwwsqldesigner.js | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index eb8abbf..a19ac2c 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,8 @@ WWW SQL Designer - + + diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js index f82c5ec..e31167d 100644 --- a/js/wwwsqldesigner.js +++ b/js/wwwsqldesigner.js @@ -1399,8 +1399,22 @@ SQL.TableManager.prototype.remove = function(e) { SQL.TableManager.prototype.edit = function(e) { this.owner.window.open(_("edittable"), this.dom.container, this.save); - this.dom.name.value = this.selected.getTitle(); - this.dom.comment.value = this.selected.getComment(); + + var title = this.selected.getTitle(); + this.dom.name.value = title; + try { /* throws in ie6 */ + this.dom.comment.value = this.selected.getComment(); + } catch(e) {} + + /* pre-select table name */ + this.dom.name.focus(); + if (OZ.ie) { + try { /* throws in ie6 */ + this.dom.name.select(); + } catch(e) {} + } else { + this.dom.name.setSelectionRange(0, title.length); + } } SQL.TableManager.prototype.keys = function(e) { /* open keys dialog */