Skip to content

Instantly share code, notes, and snippets.

@tmoreira2020
Created June 29, 2011 16:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tmoreira2020/1054306 to your computer and use it in GitHub Desktop.
Liferay Alloy popup async
AUI().use('aui-dialog', function(A) {
Liferay.YourPlugin = {
closePopup: function() {
var instance = this;
var popup = instance._getPopup()
if (popup) {
popup.hide();
}
},
displayPopup: function(url, title) {
var instance = this;
var popup = instance._getPopup();
popup.show();
popup.set('title', title);
popup.io.set('uri', url);
popup.io.start();
},
_getPopup: function() {
var instance = this;
if (!instance._popup) {
instance._popup = new A.Dialog(
{
resizable: false,
width: 600,
xy: [15,15]
}
).plug(
A.Plugin.IO,
{autoLoad: false}
).render();
}
return instance._popup;
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment