Review Board 1.7.22


Registering popup definitions

Review Request #5061 - Created May 8, 2012 and submitted

Chris Geer
RAVE-613
Reviewers
rave
rave
This adds the ability to register new popup definitions to be used inside the container. This is to overcome the issue where we can't skin the current popups.

This is my initial approach. Let me know if there is a better way to handle this. Ref mailing list discussion at: http://markmail.org/thread/nipyntndlktosi67
This capability requires having custom js so it isn't able to test as part of the standard rave install. I use the files below to register my popup which works. Then I use a modified open_views gadget to load it. The JS below needs to be loaded through the custom_js.tag mechanism into the container.

var rave = rave || {};

var fullwidth_dialog = {
        name:"dialog",
        containerSelector:'.popup.dialog',
        contentSelector:'.modal-body',
        markup:'<div class="popup dialog modal fade"><div class="modal-body"></div></div>',
        initialize:function (container) {
            container.find(this.contentSelector).data('popupType', this.name);
            var cfg = {
            };
            container.modal(cfg);

            container.on('hidden', function () {
                container.detach();
            })
        },
        cleanup:function (content) {
            var container = content.parents(this.containerSelector);

            container.modal('hide');
        },
        singleton:false
    };

rave.registerPopup("fullwidth_dialog", fullwidth_dialog);
Ship it!
Posted (May 8, 2012, 2:28 a.m.)
Nice solution.  Let's implementers override existing definitions or provide their own.
Ship it!
Posted (May 8, 2012, 2:38 p.m.)
Looks good to me.