summaryrefslogtreecommitdiffstats
path: root/js/options.js
diff options
context:
space:
mode:
authorOndrej Zara <ondrej.zara@firma.seznam.cz>2015-06-12 13:11:35 +0200
committerOndrej Zara <ondrej.zara@firma.seznam.cz>2015-06-12 13:11:35 +0200
commit097b9e89c95e4de2c184f40a1e8ef5e05bda9ddc (patch)
tree4932604432d1a57d3c4933ed80337f388fa70f53 /js/options.js
parent6fb6ba452f2bd616b6fe8d2edd0273e63b6e3f62 (diff)
downloadwwwsqldesigner-097b9e89c95e4de2c184f40a1e8ef5e05bda9ddc.zip
wwwsqldesigner-097b9e89c95e4de2c184f40a1e8ef5e05bda9ddc.tar.gz
wwwsqldesigner-097b9e89c95e4de2c184f40a1e8ef5e05bda9ddc.tar.bz2
no more OZ.Class(), dedicated pubsub, std bind
Diffstat (limited to 'js/options.js')
-rw-r--r--js/options.js37
1 files changed, 3 insertions, 34 deletions
diff --git a/js/options.js b/js/options.js
index 64dbd95..90854e5 100644
--- a/js/options.js
+++ b/js/options.js
@@ -1,15 +1,13 @@
/* --------------------- options ------------ */
-SQL.Options = OZ.Class();
-
-SQL.Options.prototype.init = function(owner) {
+SQL.Options = function(owner) {
this.owner = owner;
this.dom = {
container:OZ.$("opts"),
btn:OZ.$("options")
}
this.dom.btn.value = _("options");
- this.save = this.bind(this.save);
+ this.save = this.save.bind(this);
this.build();
}
@@ -51,7 +49,7 @@ SQL.Options.prototype.build = function() {
}
- OZ.Event.add(this.dom.btn, "click", this.bind(this.click));
+ OZ.Event.add(this.dom.btn, "click", this.click.bind(this));
this.dom.container.parentNode.removeChild(this.dom.container);
}
@@ -76,32 +74,3 @@ SQL.Options.prototype.click = function() {
this.dom.optionshowsize.checked = this.owner.getOption("showsize");
this.dom.optionshowtype.checked = this.owner.getOption("showtype");
}
-
-/* ------------------ 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");
-}