Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created September 23, 2013 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduardolundgren/6676965 to your computer and use it in GitHub Desktop.
Save eduardolundgren/6676965 to your computer and use it in GitHub Desktop.
AUI().use('event-resize', function(A) {
A.one(window).on('resize', function(event) {
dialog.align();
});
});
@BrettSwaim
Copy link

UserQuestions = function(noPopup, url) {
if (!noPopup) {
openModal("Questions", url);
}

function openModal(title, url) {
    var width = 675;

    var dialog = Liferay.Util.openWindow(
        {
            dialog: {
                centered: true,
                cssClass: 'user-questions',
                constrain2view: true,
                modal: true,
                width: width
            },
            title: title,
            uri: url
        }
    );

    AUI().use('event-resize', function(A) {
        A.one(window).on('resize', function(event) {
            dialog.align();
        });
    });
}

};

@BrettSwaim
Copy link

UserQuestions = function(noPopup, url) {
if (!noPopup) {
openModal("Questions", url);
}

function openModal(title, url) {
    var width = 675;

    var dialog = Liferay.Util.openWindow(
        {
            dialog: {
                centered: true,
                cssClass: 'user-questions',
                constrain2view: true,
                modal: true,
                width: width
            },
            title: title,
            uri: url
        }
    );

    console.log("A.one(window)" + A.one(window));

    AUI().use('event-resize', function(A) {
        A.one(window).on('resize', function(event) {
            console.log('foo');
            console.log('dialog: ' + dialog);
        });
    });
}

};

@eduardolundgren
Copy link
Author

Liferay.provide(
        window,
        'openModal',
        function(title, url) {
            var A = AUI();
            var width = 675;

            var dialog = Liferay.Util.openWindow(
                {
                    dialog: {
                        centered: true,
                        cssClass: 'user-questions',
                        constrain2view: true,
                        modal: true,
                        width: width
                    },
                    title: title,
                    uri: url
                }
            );

            A.one(window).on('resize', function(event) {
                console.log('foo');
                console.log('dialog: ' + dialog);
            });
        },
        ['event-resize']
    );

@BrettSwaim
Copy link

UserQuestions = function(noPopup, url) {
if (!noPopup) {
openModal("Questions", url);
}

Liferay.provide(
    window,
    'openModal',
    function(title, url) {
        var A = AUI();
        var width = 675;

        var dialog = Liferay.Util.openWindow(
            {
                dialog: {
                    centered: true,
                    cssClass: 'user-questions',
                    constrain2view: true,
                    modal: true,
                    width: width
                },
                title: title,
                uri: url
            }
        );

        A.one(window).on('resize', function(event) {
            console.log('foo');
            console.log('dialog: ' + dialog);
        });
    },
    ['event-resize']
);

};

@eduardolundgren
Copy link
Author

UserQuestions = function(noPopup, url) {
    if (!noPopup) {
        openModal("Questions", url);
    }
};

Liferay.provide(
    window,
    'openModal',
    function(title, url) {
        var A = AUI();
        var width = 675;

        var dialog = Liferay.Util.openWindow({
            dialog: {
                centered: true,
                cssClass: 'user-questions',
                constrain2view: true,
                modal: true,
                width: width
            },
            title: title,
            uri: url
        });

        A.one(window).on('resize', function(event) {
            console.log('foo');
            console.log('dialog: ' + dialog);
        });
    }, ['event-resize']
);

@BrettSwaim
Copy link

UserQuestions = function(noPopup, url) {
    if (!noPopup) {
        openModal("Questions", url);
    }
};

Liferay.provide(
    window,
    'openModal',
    function(title, url) {
        var A = AUI();
        var width = 675;

        var dialog = Liferay.Util.openWindow(
            {
                dialog: {
                    centered: true,
                    cssClass: 'user-questions',
                    constrain2view: true,
                    modal: true,
                    width: width
                },
                title: title,
                uri: url
            }
        );

        A.one(window).on('resize', function(event) {
            console.log('foo');
            console.log('dialog: ' + dialog);
        });
    },
    ['event-resize']
)

@eduardolundgren
Copy link
Author

UserQuestions = function(noPopup, url) {
    if (!noPopup) {
        openModal("Questions", url);
    }
};

Liferay.provide(
    window,
    'openModal',
    function(title, url) {
        var A = AUI();
        var width = 675;

        Liferay.Util.openWindow({
            dialog: {
                centered: true,
                cssClass: 'user-questions',
                constrain2view: true,
                modal: true,
                width: width
            },
            id:'userQuestionsId',
            title: title,
            uri: url
        });

        A.one(window).on('resize', function(event) {
            var userQuestionsDialog = Liferay.Util.getWindow('userQuestionsId');
            console.log('foo');
            console.log('dialog: ' + userQuestionsDialog);
        });
    }, ['event-resize']
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment