Using a separate bootstrap for frontend usage
authorAlexander Ebert <ebert@woltlab.com>
Tue, 12 May 2015 12:20:08 +0000 (14:20 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 12 May 2015 12:20:08 +0000 (14:20 +0200)
com.woltlab.wcf/templates/headIncludeJavaScript.tpl
wcfsetup/install/files/js/WoltLab/WCF/Bootstrap.js
wcfsetup/install/files/js/WoltLab/WCF/BootstrapFrontend.js [new file with mode: 0644]
wcfsetup/install/files/style/tabMenu.less

index 698d51ed80e131557f1dc13e10f9ee788e3682e5..a519805d9943bc74d2cb27e5a5e5e58ef1ec9d67 100644 (file)
        define('jquery', [], function() { return window.jQuery; });
        
        $.holdReady(true);
-       require(['WoltLab/WCF/Bootstrap'], function(bootstrap) {
-               bootstrap.setup();
+       require(['WoltLab/WCF/BootstrapFrontend'], function(BootstrapFrontend) {
+               BootstrapFrontend.setup();
        });
 </script>
 
index 642eda0c8fb4f79f96a986eceb346853f39568a7..62a02324314e994901ee6c6d18b324e72570fe45 100644 (file)
@@ -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 (file)
index 0000000..764a27c
--- /dev/null
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
+ * @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
index 7da4bbe5b85211dad53f76e546bef1d2de0a013b..4ee788e97922cf6d53eddfbcad1e7ca2e9d44655 100644 (file)
@@ -2,6 +2,8 @@
        line-height: @wcfBaseLineHeight;
        
        > .tabMenu {
+               margin-top: @wcfGapLarge;
+               
                > ul {
                        font-size: 0;
                        white-space: nowrap;
 }
 
 .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;
+                       }
                }
        }