remove tab autoTabActivation option (unused)

This commit is contained in:
wxiaoguang 2025-03-11 09:41:24 +08:00
parent e5d3d03eb8
commit 6c4a6a13b2
3 changed files with 3 additions and 8 deletions

View File

@ -77,7 +77,7 @@ export function initGlobalDropdown() {
}
export function initGlobalTabularMenu() {
fomanticQuery('.ui.menu.tabular:not(.custom) .item').tab({autoTabActivation: false});
fomanticQuery('.ui.menu.tabular:not(.custom) .item').tab();
}
// for performance considerations, it only uses performant syntax

View File

@ -75,7 +75,7 @@ class ImageDiff {
this.containerEl = containerEl;
containerEl.setAttribute('data-image-diff-loaded', 'true');
fomanticQuery(containerEl).find('.ui.menu.tabular .item').tab({autoTabActivation: false});
fomanticQuery(containerEl).find('.ui.menu.tabular .item').tab();
// the container may be hidden by "viewed" checkbox, so use the parent's width for reference
this.diffContainerWidth = Math.max(containerEl.closest('.diff-file-box').clientWidth - 300, 100);

View File

@ -2,8 +2,7 @@ import $ from 'jquery';
import {queryElemSiblings} from '../../utils/dom.ts';
export function initFomanticTab() {
$.fn.tab = function (this: any, arg0: any) {
const autoTabActivation = arg0?.autoTabActivation;
$.fn.tab = function (this: any) {
for (const elBtn of this) {
const tabName = elBtn.getAttribute('data-tab');
if (!tabName) continue;
@ -14,10 +13,6 @@ export function initFomanticTab() {
elBtn.classList.add('active');
elTab.classList.add('active');
});
if (autoTabActivation && elBtn.classList.contains('active')) {
const elTab = elBtn.querySelector(`.ui.tab[data-tab="${tabName}"]`);
elTab.classList.add('active');
}
}
return this;
};