Is there any event fired when changing tab in projects view in JIRA 5.0?

Jakub Papcun February 6, 2012

Hi,

I have a problem with javascript. I followed the steps to get rid of all $webResourceManager.requireResource in my velocity files on THIS PAGE. The problem is that I need to execute some javascript function after the content of some tab in projects view is all loaded. e.g.: I am on Road Map tab and I click on tab defined in our plug-in I need to execute this function after this page is loaded. Is there any kind of the event that is fired when I go through tabs (similar to "dialogContentReady" when opening popup window.)? I tried just "ready" event which is fired only on refresh of all tabs but not when going between tabs. "load" event doesn't work at all.

Thanks for any help.

2 answers

1 accepted

1 vote
Answer accepted
Jakub Papcun November 26, 2012

Ok so I found the answer for this finally.

For Project tab panels is used

JIRA.Project.navigationTabs.addLoadEvent(tabId, function);

and for the User profile tab panels

JIRA.TabManager.navigationTabs.addLoadEvent(tabId, function);

where tabId is the ID of the tab which we are switching to and function is the function that is to be executed after the tab is loaded.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 6, 2012

The linked page mentions JIRA.Events.NEW_CONTENT_ADDED - did you try that?

Jakub Papcun February 6, 2012

Yes I did and tried everything mentioned on that page. It seems that I have some problems with <context>atl.general</context> as it caused some issue with plugin loading and it did't load while starting JIRA

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2012

you could try the jquery aop plugin to hook into whatever function loads the content... I think you need to get your resource contexts working though.

Suggest an answer

Log in or Sign up to answer