tabs: ensure tabs are showed/hidden when setting a panels value
This commit is contained in:
parent
f298d73d1d
commit
75f50c044c
1 changed files with 4 additions and 10 deletions
|
|
@ -175,18 +175,12 @@ module.exports = class Panel extends _widgets_base {
|
|||
setValue(v, options={}) {
|
||||
if (this.tabs.length && typeof v == 'number' && v >= 0 && v < this.tabs.length) {
|
||||
|
||||
if (v != this.value) {
|
||||
|
||||
for (let i in this.tabs) {
|
||||
|
||||
this.tabs[i].hide()
|
||||
}
|
||||
|
||||
|
||||
this.value = v
|
||||
|
||||
for (let i in this.tabs) {
|
||||
this.tabs[i].hide()
|
||||
}
|
||||
|
||||
this.value = v
|
||||
|
||||
this.tabs[v].show()
|
||||
DOM.each(this.navigation, 'li', (el)=>{el.classList.remove('on')})[v].classList.add('on')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue