luci-base: delay cbi-tab-active event on tab init
Delay the cbi-tab-active custom event so any eventListner attached to the tab doesn't miss the first event. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
This commit is contained in:
parent
44d02afab1
commit
84ba852993
1 changed files with 5 additions and 3 deletions
|
@ -3597,9 +3597,11 @@ var UI = baseclass.extend(/** @lends LuCI.ui.prototype */ {
|
||||||
this.setActiveTabId(panes[selected], selected);
|
this.setActiveTabId(panes[selected], selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
panes[selected].dispatchEvent(new CustomEvent('cbi-tab-active', {
|
requestAnimationFrame(L.bind(function(pane) {
|
||||||
detail: { tab: panes[selected].getAttribute('data-tab') }
|
pane.dispatchEvent(new CustomEvent('cbi-tab-active', {
|
||||||
}));
|
detail: { tab: pane.getAttribute('data-tab') }
|
||||||
|
}));
|
||||||
|
}, this, panes[selected]));
|
||||||
|
|
||||||
this.updateTabs(group);
|
this.updateTabs(group);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue