Add a JavaScript view for showing modal dialogs.
Review Request #6305 — Created Sept. 9, 2014 and submitted
RB.DialogViewis a wrapper around$.modalBox()that makes it easy to
construct, show, and hide modal dialogs. It can be instantiated and
bound to an element to show the contents of that element as a dialog, or
it can be subclassed to allow another view to act as a dialog.
Used this in a couple other changes I've been working on. Had it here
a while and decided to just pull it out and submit it.Unit tests pass. Note that I didn't add unit tests for actually showing
the dialog, since it's a modal dialog that updatesdocument.body, and
thus couldn't easily be sandboxed.
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/ui/views/dialogView.js reviewboard/static/rb/js/ui/views/tests/dialogViewTests.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/ui/views/dialogView.js reviewboard/static/rb/js/ui/views/tests/dialogViewTests.js