Forums de discussion

[SOLVED] Theme-specific JavaScripts in popups

thumbnail
Natalie D, modifié il y a 11 années.

[SOLVED] Theme-specific JavaScripts in popups

Junior Member Publications: 55 Date d'inscription: 06/02/12 Publications récentes
Do somebody know, why theme-specific javascripts are not included inside Liferay's popups (iframe placed inside div) like one below

<aui:script>
	Liferay.provide(
		window,
		'showMyPopup',
		function(url, title) {
			var instance = this;

			Liferay.Util.openWindow({
			// ......
		['liferay-util-window']
	);
</aui:script>


But for example, all theme's CSS files are visible inside <head> tag of the popup, opened this way...
What is going one here?
thumbnail
Natalie D, modifié il y a 11 années.

RE: Theme JS in popups (Réponse)

Junior Member Publications: 55 Date d'inscription: 06/02/12 Publications récentes
Source of the problem stay the same, but I've used workaround.

Inside popup I've included all my javascripts files on my own. For example:


<script type="text/javascript" src="/my-theme/js/all-my-js-functions.js">
</script>


Hope it helps somebody.
thumbnail
Ondřej Životský, modifié il y a 10 années.

RE: Theme JS in popups

Junior Member Publications: 29 Date d'inscription: 11/03/11 Publications récentes
Today I encountered the same problem and found a solution ....

The problem is that you are adding javascript to portal_normal.vm and not to portal_pop_up.vm
Add your dependencies to head in portal_pop_up.vm and everything will be OK.

I hope it will be useful for someone