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);
|
||||
}
|
||||
|
||||
panes[selected].dispatchEvent(new CustomEvent('cbi-tab-active', {
|
||||
detail: { tab: panes[selected].getAttribute('data-tab') }
|
||||
}));
|
||||
requestAnimationFrame(L.bind(function(pane) {
|
||||
pane.dispatchEvent(new CustomEvent('cbi-tab-active', {
|
||||
detail: { tab: pane.getAttribute('data-tab') }
|
||||
}));
|
||||
}, this, panes[selected]));
|
||||
|
||||
this.updateTabs(group);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue