{foreach from=$tree item=sitemapName}
<div id="sitemap_{$sitemapName}" class="tabMenuContent hidden">
- {if $sitemapName == $defaultSitemapName}{@$sitemap}{/if}
+ <div class="section">{if $sitemapName == $defaultSitemapName}{@$sitemap}{/if}</div>
</div>
{/foreach}
</div>
* Bootstraps WCF's JavaScript with additions for the frontend usage.
*
* @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLab/WCF/BootstrapFrontend
*/
/**
* @exports WoltLab/WCF/BootstrapFrontend
*/
- var BootstrapFrontend = {
+ return {
/**
* Bootstraps general modules and frontend exclusive ones.
*
setup: function(options) {
Bootstrap.setup();
- //ControllerSitemap.setup();
+ ControllerSitemap.setup();
if (options.styleChanger) {
//ControllerStyleChanger.setup();
}
}
};
-
- return BootstrapFrontend;
});
"use strict";
var _cache = [];
- var _dialog = null;
/**
* @exports WoltLab/WCF/Controller/Sitemap
*/
- var ControllerSitemap = {
+ return {
/**
* Binds click handler.
*/
setup: function() {
- elById('sitemap').addEventListener('click', this._click.bind(this));
+ elBySel('#sitemap > a').addEventListener(WCF_CLICK_EVENT, this.open.bind(this));
},
/**
* Handles clicks on the sitemap button.
*
- * @param {object} event event object
+ * @param {Event} event event object
*/
- _click: function(event) {
+ open: function(event) {
event.preventDefault();
UiDialog.open(this);
_ajaxSuccess: function(data) {
_cache.push(data.returnValues.sitemapName);
- elById('sitemap_' + data.returnValues.sitemapName).innerHTML = data.returnValues.template;
+ elById('sitemap_' + data.returnValues.sitemapName).children[0].innerHTML = data.returnValues.template;
},
_dialogSetup: function() {
return {
id: 'sitemapDialog',
options: {
- disableContentPadding: true,
title: Language.get('wcf.page.sitemap')
},
source: {
}
}
};
-
- return ControllerSitemap;
});
setupData.source();
}
else if (Core.isPlainObject(setupData.source)) {
- Ajax.api(this, setupData.source.data, (function(data) {
- if (data.returnValues && typeof data.returnValues.template === 'string') {
- this.open(callbackObject, data.returnValues.template);
-
- if (typeof setupData.source.after === 'function') {
- setupData.source.after(_dialogs.get(setupData.id).content, data);
+ if (typeof html === 'string' && html.trim() !== '') {
+ setupData.source = html;
+ }
+ else {
+ Ajax.api(this, setupData.source.data, (function (data) {
+ if (data.returnValues && typeof data.returnValues.template === 'string') {
+ this.open(callbackObject, data.returnValues.template);
+
+ if (typeof setupData.source.after === 'function') {
+ setupData.source.after(_dialogs.get(setupData.id).content, data);
+ }
}
- }
- }).bind(this));
+ }).bind(this));
+
+ // deferred initialization
+ return {};
+ }
}
else {
if (typeof setupData.source === 'string') {
var content;
if (element === null) {
- content = elCreate('div');
-
if (typeof html === 'string') {
+ content = elCreate('div');
+ content.id = id;
content.innerHTML = html;
}
else if (html instanceof DocumentFragment) {
if (html.children[0].nodeName !== 'div' || html.childElementCount > 1) {
+ content = elCreate('div');
+ content.id = id;
content.appendChild(html);
}
else {
- content = html.children[0];
+ content = html;
}
}
-
- content.id = id;
}
else {
content = element;
--- /dev/null
+.sitemapList {
+ h3 {
+ padding-bottom: 5px;
+
+ @include wcfFontHeadline;
+ }
+
+ a {
+ display: block;
+ padding: 2px 10px;
+
+ &:hover {
+ background-color: $wcfTabularBoxBackgroundActive;
+ }
+ }
+
+ > li {
+ & + li {
+ border-top: 1px solid $wcfContentBorderInner;
+ margin-top: 5px;
+ padding-top: 5px;
+ }
+
+ > ul > li {
+ > a {
+ padding-left: 20px;
+ }
+
+ > ul > li > a {
+ padding-left: 40px;
+ }
+ }
+ }
+}