=== modified file 'lava_server/htdocs/js/jquery.lava.sidebar.js'
@@ -10,20 +10,12 @@
$.widget("lava.sidebar", {
options: {
- // hidden by default (unless pinned)
- hidden: true,
- // not pinned by default
- pinned: false,
- pinnedCookieName: "lava-sidebar-pinned",
- pinnedCookiePath: "/",
+ hidden: false,
extraControls: [],
onShow: null,
onHide: null,
onDestroy: null,
- onPin: null,
- onUnpin: null,
},
- _pin_button: null,
_close_button: null,
_controls: null,
controls: function() {
@@ -37,8 +29,6 @@
// If the sidebar was empty then just hide it
this.element.hide();
} else {
- // Load cookie to check for pin status
- this._load_pin_option();
// Initialize basic stuff:
// 1) css class
// 2) click handler
@@ -56,18 +46,6 @@
"class": "lava-sidebar-controls"
})
.prependTo(this.element);
- // Initialize pin button
- self._pin_button = $("<span/>", {
- title: "Pin/unpin the sidebar"
- })
- .button({
- text: false,
- icons: { primary: this.options.pinned ? 'ui-icon-pin-s' : 'ui-icon-pin-w'}
- })
- .click(function(event) {
- self.element.sidebar("option", "pinned", !self.options.pinned);
- })
- .appendTo(self._controls);
// Initialize close button
self._close_button = $("<span/>", {
title: "Collapse the sidebar"
@@ -89,7 +67,7 @@
},
_init: function() {
/* Initializer */
- if (this.options.pinned == false && this.options.hidden == true) {
+ if (this.options.hidden == true) {
this.hide();
} else {
this.show();
@@ -122,40 +100,6 @@
this.options.onHide();
}
},
- pin: function() {
- /* Pin the sidebar so that it is shown by default */
- this._set_pinned(true);
- },
- unpin: function() {
- /* Unpin the sidebar */
- this._set_pinned(false);
- },
- _set_pinned: function(pin_state) {
- this.options.pinned = (pin_state == true);
- this._pin_button.button("option", "icons", { primary: this.options.pinned ? 'ui-icon-pin-s' : 'ui-icon-pin-w'});
- this._save_pin_option();
- if (this.options.pinned == true && this.options.onPin) {
- this.options.onPin();
- }
- if (this.options.pinned == false && this.options.onUnpin) {
- this.options.onUnpin();
- }
- },
- _load_pin_option: function() {
- this.options.pinned = $.cookie(
- this.options.pinnedCookieName, {
- path: this.optionsPinnedCookiePath,
- expires: 365
- }) == "pinned";
- },
- _save_pin_option: function() {
- $.cookie(
- this.options.pinnedCookieName,
- this.options.pinned ? "pinned" : "", {
- path: this.options.pinnedCookiePath,
- expires: 365
- });
- },
_setOption: function(key, value) {
/* jQueryUI widget method for implementing option setter */
$.Widget.prototype._setOption.apply(this, arguments);
@@ -166,9 +110,6 @@
this.show();
}
}
- if (key == "pinned") {
- this._set_pinned(value);
- }
}
});
})(jQuery);