tabs: ensure tabs are showed/hidden when setting a panels value

This commit is contained in:
jean-emmanuel 2018-01-20 12:22:14 +01:00
parent f298d73d1d
commit 75f50c044c

View file

@ -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')