Skip to content

Commit

Permalink
* tabs: refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Jul 14, 2024
1 parent 6972520 commit 9c0728a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/tabs/src/vanilla/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ACTIVE_CLASS = 'active';
export class Tabs extends Component<{}, {show: [target: string], shown: [target: string]}> {
static NAME = 'Tabs';

#timer = 0;
_timer = 0;

active(selector?: Selector) {
const $nav = this.$element;
Expand Down Expand Up @@ -39,13 +39,13 @@ export class Tabs extends Component<{}, {show: [target: string], shown: [target:
$activePane.addClass('active').trigger('show', [name]);

this.emit('show', name);
if (this.#timer) {
clearTimeout(this.#timer);
if (this._timer) {
clearTimeout(this._timer);
}
this.#timer = setTimeout(() => {
this._timer = setTimeout(() => {
$activePane.addClass('in').trigger('shown', [name]);
this.emit('shown', name);
this.#timer = 0;
this._timer = 0;
}, 10) as unknown as number;
}
}
Expand Down

0 comments on commit 9c0728a

Please sign in to comment.