32 lines
690 B
JavaScript
32 lines
690 B
JavaScript
//open the url in a liferay popup
|
|
function showWPPopup(url) {
|
|
var url = url;
|
|
// this is one way of calling a pop-up in liferay
|
|
// this way is specific to liferay
|
|
Liferay.Util.openWindow(
|
|
{
|
|
dialog: {
|
|
cache: false,
|
|
width:600,
|
|
height: 450,
|
|
modal: true
|
|
},
|
|
id: 'testPopupIdUnique',
|
|
uri: url
|
|
}
|
|
);
|
|
}
|
|
|
|
function closeWPPopup() {
|
|
var dialog = Liferay.Util.getWindow('testPopupIdUnique');
|
|
dialog.destroy(); // You can try toggle/hide whatever You want
|
|
}
|
|
|
|
function fireEvent(eventName, eventValue) {
|
|
Liferay.Util.getOpener().Liferay.fire('getUserData',{
|
|
name: eventValue
|
|
});
|
|
console.log('fireEvent:done');
|
|
closeWPPopup();
|
|
}
|