if ($target.hasClass('activeMenuItem')) {
return;
}
-
+
this._renderSidebar($target.data('menuItem'), []);
+
+ // force sidebar to be displayed
+ this._sidebarNavigation.wcfSidebar('show');
},
/**
+/* TODO: This is just a prototype for collapsible sidebars */
+.collapsibleSidebarButton {
+ background-color: rgb(216, 231, 245);
+ border: 1px solid rgb(192, 192, 192);
+ border-left-width: 0;
+ border-radius: 0 3px 3px 0;
+ padding: 3px;
+ opacity: 0.6;
+ position: absolute;
+ right: -15px;
+ top: 46%;
+ z-index: 101;
+
+ -webkit-transition: opacity .2s linear;
+ -moz-transition: opacity .2s linear;
+ -ms-transition: opacity .2s linear;
+ -o-transition: opacity .2s linear;
+ transition: opacity .2s linear;
+}
+.collapsibleSidebarButton:hover {
+ cursor: pointer;
+ opacity: 1.0;
+}
new WCF.Effect.SmoothScroll();
new WCF.Effect.BalloonTooltip();
$('<span class="arrowOuter"><span class="arrowInner"></span></span>').appendTo('.innerError');
+
+ $('#sidebarMenu').wcfSidebar();
});
//]]>
</script>
}
};
+/**
+ * Provides a toggleable sidebar.
+ */
+$.widget('ui.wcfSidebar', {
+ /**
+ * toggle button
+ * @var jQuery
+ */
+ _button: null,
+
+ /**
+ * sidebar visibility
+ * @var boolean
+ */
+ _visible: true,
+
+ /**
+ * Creates a new toggleable sidebar.
+ */
+ _create: function() {
+ this.element.wrap('<div class="collapsibleSidebar"></div>');
+
+ // create toggle button
+ this._button = $('<span class="collapsibleSidebarButton">«</div>').appendTo(this.element.parent('div'));
+
+ // bind event
+ this._button.click($.proxy(this._toggle, this));
+ },
+
+ /**
+ * Toggles visibility on button click.
+ */
+ _toggle: function() {
+ if (this._visible) {
+ this.hide();
+ }
+ else {
+ this.show();
+ }
+ },
+
+ /**
+ * Shows sidebar content.
+ */
+ show: function() {
+ if (this._visible) {
+ return;
+ }
+
+ this._visible = true;
+ this.element.wcfBlindIn('horizontal', $.proxy(function() {
+ this._button.html('«');
+ }, this));
+ },
+
+ /**
+ * Hides the sidebar content.
+ */
+ hide: function() {
+ if (!this._visible) {
+ return;
+ }
+
+ this._visible = false;
+ this.element.wcfBlindOut('horizontal', $.proxy(function() {
+ this._button.html('»');
+ }, this));
+ }
+});
+
/**
* Basic implementation for WCF dialogs.
*/