Hi,
I am currently trying to open a popup like the one in the image:
popup.PNG
I use the issueaction-log-work style class to get this kind of popup. If I click the link my popup opens as expected except the fact that my css file in the plugin isn't loaded. This is my code:
<web-resource key="pluginname-resources" > <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="pluginname.css" location="/css/pluginname.css" /> ... </web-resource> <web-item name="issue-send-mail" section="operations-top-level" ... > <label key="issue--send--mail.label" /> <link linkId="issue--send--mail-link">/plugins/servlet/fancyServlet</link> <styleClass>issueaction-log-work</styleClass> </web-item>
<html> <head> <title>Popup!title> $webResourceManager.requireResourcesForContext("my.fancy.plugin:pluginname-resources") </head> <body> .. other stuff .. </body> </html>
I had the idea that maybe the whole <head>..</head> part is being ignored because there is already a head. If i open the site directly (without popup) my css is being loaded. So I tried to move the $webResourceManager.requireResourcesForContext("my.fancy.plugin:pluginname-resources") line:
<html> <head> <title>Popup!title> </head> <body> $webResourceManager.requireResourcesForContext("my.fancy.plugin:pluginname-resources") .. other stuff .. </body> </html>
But unfortunately this isn't working, too.
Is there any other way to get my css loaded when opening the page in a popup?
Community moderators have prevented the ability to post new answers.
I fixed it!
In this question the solution is to use the atl.general context in the web resource definition. So the resources will be included in many pages they don't need to, but this is no big deal (at least for my purposes).
Now, the page that opens my popup already includes my css.
<web-resource key="pluginname-resources" > <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="pluginname.css" location="/css/pluginname.css" /> <context>atl.general</context> ... </web-resource>
Hi!
You need to require resource directly by key
$webResourceManager.requireResource("my.fancy.plugin:pluginname-resources")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.