Add tab.hasClass() method
This commit is contained in:
parent
16d13ed95d
commit
a15110a2bb
2 changed files with 8 additions and 0 deletions
|
@ -196,6 +196,10 @@ Toggle the "visible" class on the tab. `tab.hide()` is an alias to `tab.show(fal
|
|||
|
||||
Toggle the "flash" class on the tab. `tab.unflash()` is an alias to `tab.flash(false)`.
|
||||
|
||||
#### `tab.hasClass(classname)`
|
||||
|
||||
Return `true` if the tab element has the specified classname. Useful for checking if a tab is "active", "visible" of "flash".
|
||||
|
||||
#### `tab.close(force)`
|
||||
|
||||
Close the tab (and activate another tab if relevant). When `force` is set to `true` the tab will be closed even if it is not `closable`.
|
||||
|
|
4
index.js
4
index.js
|
@ -341,6 +341,10 @@ class Tab extends EventEmitter {
|
|||
return this.flash(false);
|
||||
}
|
||||
|
||||
hasClass (classname) {
|
||||
return this.tab.classList.contains(classname);
|
||||
}
|
||||
|
||||
close (force) {
|
||||
const abortController = new AbortController();
|
||||
const abort = () => abortController.abort();
|
||||
|
|
Loading…
Reference in a new issue