Skip to content

Commit 7305139

Browse files
committed
Added onTabChange() event to the Horizon app
1 parent ece5ac6 commit 7305139

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ui/javascript/app/Horizon.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,20 @@ javaxt.express.app.Horizon = function(parent, config) {
292292
};
293293

294294

295+
//**************************************************************************
296+
//** onTabChange
297+
//**************************************************************************
298+
/** Called whenever a tab is raised in the tab bar.
299+
* @param currTab Object with key/value pairs including:
300+
* <ul>
301+
* <li>name: Name/label of the tab (String)</li>
302+
* <li>tab: Tab in the tab bar (DOM Object)</li>
303+
* <li>panel: The panel that is rendered in the body (Object)</li>
304+
* </ul>
305+
*/
306+
this.onTabChange = function(currTab){};
307+
308+
295309
//**************************************************************************
296310
//** sendMessage
297311
//**************************************************************************
@@ -586,6 +600,13 @@ javaxt.express.app.Horizon = function(parent, config) {
586600
fn.apply(me, []);
587601
document.title = config.name + " - " + label;
588602
if (currUser) currUser.preferences.set("Tab", label);
603+
604+
605+
me.onTabChange({
606+
name: label,
607+
tab: this,
608+
panel: panels[label]
609+
});
589610
};
590611

591612

0 commit comments

Comments
 (0)