return false;
}
- var container, containers = DomTraverse.childrenByTag(this._container, 'DIV'), name;
- for (var i = 0, length = containers.length; i < length; i++) {
+ var container, containers = DomTraverse.childrenByTag(this._container, 'DIV'), name, i, length;
+ for (i = 0, length = containers.length; i < length; i++) {
container = containers[i];
name = elData(container, 'name');
}
var containerId = this._container.id, tab;
- for (var i = 0, length = tabs.length; i < length; i++) {
+ for (i = 0, length = tabs.length; i < length; i++) {
tab = tabs[i];
name = this._getTabName(tab);
});
}
- // create pointer element
- nav.appendChild(elCreate('span'));
-
return true;
},
newContent.classList.remove('hidden');
}
- var menu = tab.parentNode.parentNode;
-
- // set pointer position
- var span = DomTraverse.childByTag(menu, 'SPAN');
-
- // make sure that the tab is (temporarily) visible so that offsetLeft has the proper value
- var toggleHidden = false;
- if (menu.classList.contains('menu') && menu.parentNode.classList.contains('hidden')) {
- toggleHidden = true;
- menu.parentNode.classList.remove('hidden');
- }
-
- if (span !== null) {
- span.style.setProperty('transform', 'translateX(' + tab.offsetLeft + 'px)', '');
- span.style.setProperty('width', tab.clientWidth + 'px', '');
- }
-
- if (toggleHidden) {
- menu.parentNode.classList.add('hidden');
- }
-
if (!disableEvent) {
EventHandler.fire('com.woltlab.wcf.simpleTabMenu_' + this._container.id, 'select', {
active: tab,
@include inlineList;
> li {
+ position: relative;
+
&:not(:last-child) {
margin-right: 20px;
}
+ &::before {
+ border-top: 1px solid $wcfContentLink;
+ bottom: -1px;
+ content: "";
+ left: 50%;
+ position: absolute;
+ width: 0;
+ }
+
+ &.active::before {
+ left: 0;
+ transition: left .12s linear, width .12s linear;
+ width: 100%;
+ }
+
&.active > a {
cursor: default;
}
}
}
-
- > span {
- border-top: 1px solid $wcfContentLink;
- bottom: 0;
- position: absolute;
- transition: transform .12s linear, width .12s linear;
- }
}
@include small-screen-only {
@include inlineList;
> li {
+ position: relative;
+
+ &::before {
+ border-top: 1px solid $wcfContentLink;
+ bottom: -1px;
+ content: "";
+ left: 50%;
+ position: absolute;
+ width: 0;
+ }
+
+ &.active::before {
+ left: 0;
+ transition: left .12s linear, width .12s linear;
+ width: 100%;
+ }
+
&:not(:last-child) {
margin-right: 20px;
}
}
}
- > span {
- border-top: 1px solid $wcfContentLink;
- bottom: -5px;
- position: absolute;
- transition: transform .12s linear, width .12s linear;
- }
-
& + .tabMenuContent {
margin-top: 20px;
}