From bcbf9d85b8fe3783caade89ca1b297cd46ce6f96 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 14 Apr 2016 13:41:45 +0200 Subject: [PATCH] Removed collapsible sidebar --- .../js/WoltLab/WCF/Ui/Collapsible/Sidebar.js | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Ui/Collapsible/Sidebar.js diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Collapsible/Sidebar.js b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Collapsible/Sidebar.js deleted file mode 100644 index 9729bd8999..0000000000 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Collapsible/Sidebar.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Provides the sidebar toggle button. - * - * @author Alexander Ebert - * @copyright 2001-2015 WoltLab GmbH - * @license GNU Lesser General Public License - * @module WoltLab/WCF/Ui/Collapsible/Sidebar - */ -define(['Ajax', 'Language', 'Dom/Util'], function(Ajax, Language, DomUtil) { - "use strict"; - - var _isOpen = false; - var _main = null; - var _name = ''; - - /** - * @module WoltLab/WCF/Ui/Collapsible/Sidebar - */ - var UiCollapsibleSidebar = { - /** - * Sets up the toggle button. - */ - setup: function() { - var sidebar = elBySel('.sidebar'); - if (sidebar === null) { - return; - } - - _isOpen = (elData(sidebar, 'is-open') === 'true'); - _main = elById('main'); - _name = elData(sidebar, 'sidebar-name'); - - this._createUI(sidebar); - - _main.classList[(_isOpen ? 'remove' : 'add')]('sidebarCollapsed'); - }, - - /** - * Creates the toggle button. - * - * @param {Element} sidebar sidebar element - */ - _createUI: function(sidebar) { - var button = elCreate('a'); - button.href = '#'; - button.className = 'collapsibleButton jsTooltip'; - elAttr(button, 'title', Language.get('wcf.global.button.collapsible')); - - var span = elCreate('span'); - span.appendChild(button); - DomUtil.prepend(span, sidebar); - - button.addEventListener('click', this._click.bind(this)); - }, - - /** - * Toggles the sidebar on click. - * - * @param {object} event event object - */ - _click: function(event) { - event.preventDefault(); - - _isOpen = (_isOpen === false); - - Ajax.api(this, { - isOpen: ~~_isOpen - }); - }, - - _ajaxSetup: function() { - return { - data: { - actionName: 'toggle', - className: 'wcf\\system\\user\\collapsible\\content\\UserCollapsibleSidebarHandler', - sidebarName: _name - }, - url: 'index.php/AJAXInvoke/?t=' + SECURITY_TOKEN + SID_ARG_2ND - }; - }, - - _ajaxSuccess: function(data) { - _main.classList[(_isOpen ? 'remove' : 'add')]('sidebarCollapsed'); - } - }; - - return UiCollapsibleSidebar; -}); -- 2.20.1