diff options
author | ondrej.zara <none@none> | 2010-03-30 06:01:34 +0000 |
---|---|---|
committer | ondrej.zara <none@none> | 2010-03-30 06:01:34 +0000 |
commit | 94a07292ad4b1e9e167e4078fa23ce0eec982cfe (patch) | |
tree | 57816f55d492563f80a4f1f788aaa771b8cbb90d /js/wwwsqldesigner.js | |
parent | 2f64c730ca8bcebd255a51d8f00b74ad339f3c5f (diff) | |
download | wwwsqldesigner-94a07292ad4b1e9e167e4078fa23ce0eec982cfe.zip wwwsqldesigner-94a07292ad4b1e9e167e4078fa23ce0eec982cfe.tar.gz wwwsqldesigner-94a07292ad4b1e9e167e4078fa23ce0eec982cfe.tar.bz2 |
#88 toolbar hiding
--HG--
extra : convert_revision : svn%3Ab267cdba-c1da-11dd-874b-8bacd04a0a74/trunk%4099
Diffstat (limited to 'js/wwwsqldesigner.js')
-rw-r--r-- | js/wwwsqldesigner.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js index c5f94b1..f4df04c 100644 --- a/js/wwwsqldesigner.js +++ b/js/wwwsqldesigner.js @@ -2152,6 +2152,35 @@ SQL.Options.prototype.click = function() { this.dom.optionvector.checked = this.owner.getOption("vector"); } +/* ------------------ minimize/restore bar ----------- */ + +SQL.Toggle = OZ.Class(); + +SQL.Toggle.prototype.init = function(elm) { + this._state = null; + this._elm = elm; + OZ.Event.add(elm, "click", this._click.bind(this)); + + var defaultState = true; + if (document.location.href.match(/toolbar=hidden/)) { defaultState = false; } + this._switch(defaultState); +} + +SQL.Toggle.prototype._click = function(e) { + this._switch(!this._state); +} + +SQL.Toggle.prototype._switch = function(state) { + this._state = state; + if (this._state) { + OZ.$("bar").style.height = ""; + } else { + OZ.$("bar").style.overflow = "hidden"; + OZ.$("bar").style.height = this._elm.offsetHeight + "px"; + } + this._elm.className = (this._state ? "on" : "off"); +} + /* --------------------- www sql designer ------------ */ SQL.Designer = OZ.Class().extend(SQL.Visual); @@ -2164,6 +2193,7 @@ SQL.Designer.prototype.init = function() { this.title = document.title; SQL.Visual.prototype.init.apply(this); + new SQL.Toggle(OZ.$("toggle")); this.dom.container = this.dom.content = OZ.$("area"); this.minSize = [ |