From 3c3aa820f93228f7902adea1fd4e605f3093a384 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 8 Jun 2015 16:56:45 +0200 Subject: [PATCH] feature #3748: Add onShow event for tab panels --- src/sunstone/public/app/sunstone.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index e6d148b0b4..fe0a33941c 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -581,9 +581,17 @@ define(function(require) { $.each(panelInstances, function(index, panel) { panel.setup(context); + + if (panel.onShow) { + context.off('click', '[href="#' + panel.panelId + '"]'); + context.on('click', '[href="#' + panel.panelId + '"]', function(){ + panel.onShow(context); + }); + } }); - $(document).foundation('reflow', 'tab'); + context.foundation('reflow', 'tab'); + $('[href=' + activaTabHref + ']', context).trigger("click"); } //Runs a predefined action. Wraps the calls to opennebula.js and