Created
March 15, 2017 17:57
-
-
Save evaldeslacasa/d4e5d7da79ff6195b7305c24936a2b5e to your computer and use it in GitHub Desktop.
Liferay pop ups javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function popUpUrl(id) { | |
var url = Liferay.PortletURL.createRenderURL(); | |
url.setPortletId("56"); // "Web Content Display" portlet ID | |
url.setWindowState('pop_up'); | |
url.setPortletMode('view'); | |
url.setParameter("groupId", Liferay.ThemeDisplay.getScopeGroupIdOrLiveGroupId()); | |
url.setParameter("articleId", id); // webcontent ID | |
return url; | |
}; | |
/*AUI().ready('aui-dialog', 'aui-dialog-iframe', 'liferay-portlet-url', function(A) { | |
url = popUpUrl("POPUP_SUBSCRIPTION"); | |
console.log(url.toString()); | |
Liferay.Util.openWindow({ | |
dialog: {destroyOnHide: true}, | |
cssClass: 'aoc-pub-lightbox', | |
align: Liferay.Util.Window.ALIGN_CENTER, | |
toolbars: false, | |
resizable: true, | |
modal: true, | |
uri: url.toString()}); | |
});*/ | |
YUI().use( | |
'aui-modal', | |
function(Y) { | |
var modal = new Y.Modal( | |
{ | |
headerContent: 'Hello', | |
centered: true, | |
render: '#modal' | |
} | |
).render(); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment