Created
June 29, 2011 16:55
-
-
Save tmoreira2020/1054306 to your computer and use it in GitHub Desktop.
Liferay Alloy popup async
This file contains 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
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