summaryrefslogtreecommitdiffstats
path: root/js/wwwsqldesigner.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/wwwsqldesigner.js')
-rw-r--r--js/wwwsqldesigner.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js
index d57a243..3c04e26 100644
--- a/js/wwwsqldesigner.js
+++ b/js/wwwsqldesigner.js
@@ -271,6 +271,7 @@ SQL.Row.prototype.redraw = function() {
this.dom.container.style.backgroundColor = color;
OZ.DOM.removeClass(this.dom.container,"primary");
if (this.isPrimary()) { OZ.DOM.addClass(this.dom.container,"primary"); }
+ if (this.isKey()) { OZ.DOM.addClass(this.dom.container,"key"); }
this.dom.selected.style.display = (this.selected ? "" : "none");
this.owner.redraw();
this.owner.owner.rowManager.redraw();
@@ -440,6 +441,10 @@ SQL.Row.prototype.isUnique = function() {
return false;
}
+SQL.Row.prototype.isKey = function() {
+ return this.keys.length > 0;
+}
+
SQL.Row.prototype.enter = function(e) {
if (e.keyCode == 13) {
this.collapse();
@@ -830,7 +835,7 @@ SQL.Table.prototype.down = function(e) { /* mousedown - start drag */
}
SQL.Table.prototype.toXML = function() {
- var t = this.getTitle().replace(/"/g,""");
+ var t = this.getTitle().replace(/"/g,"""); //"
var xml = "";
xml += '<table x="'+this.x+'" y="'+this.y+'" name="'+t+'">\n';
for (var i=0;i<this.rows.length;i++) {