From 5d5ef727114e0b12b6297dba8be9ae6b352fcb2f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 12 May 2015 14:20:08 +0200 Subject: [PATCH] Using a separate bootstrap for frontend usage --- .../templates/headIncludeJavaScript.tpl | 4 +-- .../install/files/js/WoltLab/WCF/Bootstrap.js | 8 +++--- .../files/js/WoltLab/WCF/BootstrapFrontend.js | 27 +++++++++++++++++++ wcfsetup/install/files/style/tabMenu.less | 14 +++++++--- 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 698d51ed80..a519805d99 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -141,8 +141,8 @@ define('jquery', [], function() { return window.jQuery; }); $.holdReady(true); - require(['WoltLab/WCF/Bootstrap'], function(bootstrap) { - bootstrap.setup(); + require(['WoltLab/WCF/BootstrapFrontend'], function(BootstrapFrontend) { + BootstrapFrontend.setup(); }); diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Bootstrap.js b/wcfsetup/install/files/js/WoltLab/WCF/Bootstrap.js index 642eda0c8f..62a0232431 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Bootstrap.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Bootstrap.js @@ -12,12 +12,12 @@ define( [ 'jquery', 'favico', 'enquire', 'WoltLab/WCF/Date/Time/Relative', 'UI/SimpleDropdown', 'WoltLab/WCF/UI/Mobile', 'WoltLab/WCF/UI/TabMenu', 'WoltLab/WCF/UI/FlexibleMenu', - 'UI/Dialog', 'WoltLab/WCF/UI/Tooltip', 'WoltLab/WCF/Controller/Sitemap' + 'UI/Dialog', 'WoltLab/WCF/UI/Tooltip' ], function( $, favico, enquire, relativeTime, simpleDropdown, UIMobile, UITabMenu, UIFlexibleMenu, - UIDialog, UITooltip, ControllerSitemap + UIDialog, UITooltip ) { "use strict"; @@ -28,7 +28,7 @@ define( /** * @constructor */ - function Bootstrap() { } + function Bootstrap() {} Bootstrap.prototype = { /** * Initializes the core UI modifications and unblocks jQuery's ready event. @@ -42,8 +42,6 @@ define( UIDialog.setup(); UITooltip.setup(); - ControllerSitemap.setup(); - $.holdReady(false); } }; diff --git a/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js b/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js new file mode 100644 index 0000000000..764a27c4b3 --- /dev/null +++ b/wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js @@ -0,0 +1,27 @@ +/** + * Bootstraps WCF's JavaScript with additions for the frontend usage. + * + * @author Alexander Ebert + * @copyright 2001-2015 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLab/WCF/BootstrapFrontend + */ +define(['WoltLab/WCF/Bootstrap', 'WoltLab/WCF/Controller/Sitemap'], function(Bootstrap, ControllerSitemap) { + "use strict"; + + /** + * @constructor + */ + function BootstrapFrontend() {} + BootstrapFrontend.prototype = { + /** + * Bootstraps general modules and frontend exclusive ones. + */ + setup: function() { + Bootstrap.setup(); + ControllerSitemap.setup(); + } + }; + + return new BootstrapFrontend(); +}); \ No newline at end of file diff --git a/wcfsetup/install/files/style/tabMenu.less b/wcfsetup/install/files/style/tabMenu.less index 7da4bbe5b8..4ee788e979 100644 --- a/wcfsetup/install/files/style/tabMenu.less +++ b/wcfsetup/install/files/style/tabMenu.less @@ -2,6 +2,8 @@ line-height: @wcfBaseLineHeight; > .tabMenu { + margin-top: @wcfGapLarge; + > ul { font-size: 0; white-space: nowrap; @@ -135,11 +137,15 @@ } .dialogContentNoPadding .tabMenuContainer { - > nav > ul > li { - border-top-width: 0; + > nav { + margin-top: 0; - &:first-child { - border-left-width: 0; + > ul > li { + border-top-width: 0; + + &:first-child { + border-left-width: 0; + } } } -- 2.20.1