Invision UI v.19.6.0-0

Getting Started

  • Running Invision UI
  • UI Component Anatomy
  • Authoring SCSS
  • Authoring Presentational Behavior

Component Foundations

  • SCSS Authoring
    • Mixins & Variables
    • Stateful Classes
  • State Guidance
    • Empty/Zero State
    • Loading State
  • Utilities
    • Align
    • Display
    • Flexbox
    • Font Size
    • Layout
    • Offset
    • Position
    • Overflow
    • Size
    • Spacing
    • Text
  • Layout
    • Arrange [Deprectated]
    • Divided Columns
    • Embed Video
    • Full and Center
    • Fill [Deprectated]
    • Grid
    • Media Blocks
    • Panels
    • Vertical Layouts
  • Media Queries
  • Angular Behaviors
    • App Theme Directive
    • Auto Focus Input
    • Filters
    • Popup (modal dialog) Manager
    • Tether (tooltip/dropdown) Manager
    • Resize Sensor
    • Watchers

UI Component Library

  • Content & Containment
    • Active Translation
    • Auto Fit Text
    • Address
    • Basic & Input Table
    • Brand Logo/Slogan
    • Call to Action - Empty State
    • Carousel
    • Cart
    • Choice
    • Collapsible Container
    • Copyright Footer
    • Coupon Redeemer
    • Content
    • Date Relative Display
    • Definition Lists
    • Delimited List
    • Details
    • Expiration Date Display
    • Feature Toggle
    • Form Section Heading
    • Header
    • Heading
    • Heading With Annotation
    • Icons
    • Interaction Details
    • Labeled Balance
    • Link
    • Main Container
    • Metadata Card
    • Metadata List Item
    • Offering QuickView
    • Payment Instrument
    • Preference Dialog
    • Pricing Plan Decoration
    • Product Availability
    • Product Details
    • Product Image
    • Quick Info Panel
    • Remark
    • Renewal Column
    • Richlist Filterbar
    • Richlist Wrapper
    • Scrollable Horizontal List
    • Search Card
    • Search Panel
    • Section
    • Selectable Option
    • Smart Truncate
    • Status Grid
    • Tooltip
  • Data Visualizations
    • Bill Runs
    • Comparison Table
    • Datatable
    • Progress Tracker
    • Schedules
    • Query Builder
  • Dialogs
    • Confirmation Dialog
    • Dialog
    • Rich List Dialog
    • Wait Dialog
  • Forms and Filters
    • Additional Properties
    • Autocomplete
    • 3 Field Date Input
    • Checkbox
    • Credit Card
    • Bulk Action Bar
    • Buttons
    • Confirmation Button
    • Date Picker
    • E-Check
    • Entity Specification
    • External Bill
    • External Gift Card
    • Focus Group
    • Forms
    • Filter Bar
    • Filter Dropdowns
    • Gift Card
    • Grouped Check Filters
    • Inputs
    • Input Select Combo
    • Monetary Input
    • Multi Dropdown Selector
    • Multiple Numeric Input
    • Monetary Range Input
    • Password Unmask Button
    • Select
    • Select Button Or Stepper
    • Select Or Text Input
    • Stepper
    • Tag Dropdown
  • Navigation & Flow
    • Back Banner
    • Back Component
    • Breadcrumbs
    • Details Pager
    • Expandable Section
    • Infinite Scroll
    • Open New Window
    • Pager
    • Fancy Richlist
    • Standard Navigator
    • Status Indicator
    • Step Progress Bar
    • Step Progress Indicator
    • Tab Card
    • Tab Panel
    • Tier Navigator
    • Wizard
  • Notifications
    • Loading Indicator
    • Toast Notifications
  • Deprecated
    • Content Area

Showcase

  • General
    • Simplelist
    • Richlist
    • Primary (side) Navigator
  • Customer Care
    • Case Activity List
    • Customer Care Navigator Component
    • Dashboard
    • Decisions
  • Reporting
    • Content Visualization

Unit Testing

  • Actions
  • Components
  • Selectors
  • Reducers

End-to-end Testing

Statistics

Popup

In this section

Overview Variants
  • Basic Popup
  • Multiple Popups
  • Non-Modal Popup
  • Popup with Relative Container
  • Popup via PopupManager (Instance-Based)
  • Popup via PopupManager (Template-Based)
  • Popup with Close All Button
  • Popup X-Ray

Popup, not to be confused with Tether, is a modal element that does not tether with any other element. Common usage of a Popup would be a modal dialog or modal status display such as a loading indicator.

Getting Started

See Developing Modals in Invision for more extensive documentation and an example with complete code.

To declare any Popups, the most common setup will involve the following:

  1. Add a <inv-popup-vault></inv-popup-vault> directive to your component's template if it doesn't already exist.
  2. Wrap your popup's markup in an <inv-dialog></inv-dialog> directive, integrating the unsaved-changes-prompt directive when appropriate. The popup's contents isn't required to be within the dialog component, but that's a very common use case.
  3. Wrap that dialog or comparable markup, including a <inv-loading-indicator></inv-loading-indicator> directive when appropriate, in a <div> with the inv-popup directive attached, which will register the DOM element with the PopupManager.
  4. Insert this markup within the <inv-popup-vault></inv-popup-vault> so the popup will be hidden and any related $scope.$watch statements are disabled while it is at rest.

Nearly all instances of the popup component will expect the following bindings:

  • config: The config object should be a reference to the PopupInstanceApi returned from the PopupManager when the popup is registered. This object is rarely used by the popup directly, but does provide access to the center and close functions directly if they are needed for some reason. These should be used sparingly, as it's preferred that the parent component be the one to manage these types of concerns whenever possible.
  • onClose: The onClose function is called when the component's "Cancel" or "Close" buttons are clicked.
  • onSuccess: The onSuccess function will be called by the component once it has successfully been "submitted" and the API does not result in a fault code being passed back. This callback often times passes the payload of the submitted action back to the parent component via this callback in case the parent requires it (e.g. the payload may contain the ID of the newly created entity).

If the popup instance contains a form, it should also integrate the Unsaved Changes feature. In most cases, use of the unsaved-changes-prompt directive on the form element can be done with very little extra effort.

Each popup instance is responsible for managing a proper lifecycle, including cleaning up after itself. This is accomplished through the use of a ng-if directive on your popup. For example:

HTML
    <my-modal-popup
        ng-if="parentComponentController.shouldShowPopup"
        config="parentComponentController.popupConfig"
        on-close="parentComponentController.onPopupClose"
        on-success="parentComponentController.onPopupComplete">
    </my-modal-popup>

Using the ng-if causes the automatic registration/de-registration of the Unsaved Changes feature when the component's $onDestroy and $onInit methods are called. If the unsaved-changes-prompt directive is not used on the form element, ensure the component is properly de-registered using the unregisterUnsavedChanges action from Invision Core before closing the popup. Otherwise the next time you try to navigate to a new route within the application you will see the Unsaved Changes popup.

Usage of $timeout in the parent component is important. This will wait for a digest cycle before evaluating the contained function, and in almost all cases this is important as we wait to open/close a modal until its contents have been properly disposed of. Without this, the Unsaved Changes prompt may be triggered from the popup instance, for example.

  • The single digest cycle caused by using $timeout before opening the popup works for a large majority of use cases. If the popup instance is responsible for rendering content that takes longer than a single digest cycle to prepare and render (e.g. larger data tables), contact Tangent Lin for best practices that the Reporting module has used for these situations.
  • Similarly, if the popup does not have a definite height or takes more than one digest cycle to render, there may be issues with the ng-if approach. When the PopupManager attempts to open and center the popup, and the contents aren't ready, it may result in it being positioned off-center when fully rendered. Contact Tangent Lin for an alternate pattern that can cleanly address this without using ng-if.

Best Practices

Use separate configurations if there are multiple popups on the same page. For example:

JavaScript
    this.popupConfigX = {
        onRegisterApi: () => { }
    };

    this.popupConfigY = {
        onRegisterApi: () => { }
    };

Within the controller of the popup, don't override or decorate the functions of the popup instance API. For example:

JavaScript
    class ParentComponentController {
        constructor($ngRedux, $timeout) {
            // ...
        }

        $onInit() {
            // ...

            // BAD
            const onRegisterApi = this.popupConfig.onRegisterApi;

            this.popupConfig = {
                onRegisterApi = ({api: api}) => {
                    const popupApi = Object.assign({}, api, {
                        open: () => {
                            this.resetForm();

                            $timeout(() => {
                                api.open();
                            });
                        }
                    });

                    this.popupApi = popupApi;

                    onRegisterApi && onRegisterApi({api: popupApi});
                }
            };

            // GOOD
            this.popupConfig = {
                onRegisterApi: ({api: api}) => {
                    this.popupApi = api;
                }
            };
        }

        $onDestroy() {
            // ...
        }

        resetForm() {                
            // ...
        }

        showPopup() {

            // Instead of overwriting open() in the API, externalize it to achieve the same result
            this.resetForm();

            // NOTE: resetForm() would require a digest cycle, therefore using $timeout would guarantee the form gets reset
            this.$timeout(() => {
                this.popupApi.open();
            });
         }
    }

If the popup contains a form, then the ENTER key should submit the form and the ESC key should close the popup. For example:

JavaScript
    class ModalComponentController {
        constructor($ngRedux, hotkeys) {
            // ...
        }

        $onInit() {
            // ...

            hotkeys
                .add({
                    callback: (event) => {
                        event.preventDefault();

                        this.handleFormSubmit();
                    }
                    combo: 'enter'
                })
                .add({
                    callback: (event) => {
                        event.preventDefault();

                        this.handleClose();
                    }
                    combo: 'esc'
                });
        }

        $onDestroy() {
            // ...

            this.hotkeys.del('enter');
            this.hotkeys.del('esc');
        }

        handleClose() {
            // ...
        }

        handleFormSubmit() {
            // ...
        }
    }

Basic Popup

An example of a basic popup.

The state of a popup can be controlled programmatically. To get access to the API, simply obtain it through setting the onRegisterApi property in the popup's configuration (e.g. popupConfig).

Answer: {{ controller.answer }}

Red blue or green? {{ controller.count }}
HTML
<div class="t-content c-content" ng-controller="basicPopupApiExampleController as controller">
    <p>
        The state of a popup can be controlled programmatically. To get access
        to the API, simply obtain it through setting the
        <code>onRegisterApi</code> property in the popup's configuration (e.g. <code>popupConfig</code>).
    </p>
    <p>
        <button class="c-button" ng-click="controller.openDialog()">Open</button>
    </p>
    <p>Answer: {{ controller.answer }}</p>

    <inv-popup-vault>
        <div inv-popup="controller.popupConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="small"
                            dialog-title="'Your API Choice?'"
                            dialog-type="content"
                            on-close="controller.closeDialog()">
                    <dialog-content>Red blue or green? {{ controller.count }}</dialog-content>
                    <dialog-footer>
                        <button class="c-button" ng-click="controller.answerClick('Red')">
                            Red
                        </button>
                        <button class="c-button" ng-click="controller.answerClick('Green')">
                            Green
                        </button>
                        <button class="c-button" ng-click="controller.answerClick('Blue')">
                            Blue
                        </button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>
    </inv-popup-vault>
</div>

Multiple Popups

An example with multiple popups.

Who is/are going to concert?

  • Parent: {{ controller.parentAnswer }}
  • Child: {{ controller.childAnswer }}

You are bringing {{ controller.childAnswer }} to the concert.

Want to bring one of your children over? Then



HTML
<div class="t-content c-content" ng-controller="multiplePopupExampleController as controller">
    <p>Who is/are going to concert?</p>
    <p>
        <button class="c-button" ng-click="controller.openParent()">Open</button>
    </p>
    <ul>
        <li>Parent: {{ controller.parentAnswer }}</li>
        <li>Child: {{ controller.childAnswer }}</li>
    </ul>

    <inv-popup-vault>
        <div inv-popup="controller.popupParentConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="small"
                            dialog-title="'Which parent is going?'"
                            dialog-type="content"
                            on-close="controller.closeParent()">
                    <dialog-content>
                        <div ng-if="controller.childAnswer">
                            <p>You are bringing {{ controller.childAnswer }} to the concert.</p>
                            <p>
                                <button class="c-button" ng-click="controller.openChild()">Change</button>
                            </p>
                        </div>
                        <div ng-if="!controller.childAnswer">
                            Want to bring one of your children over? Then
                            <button class="c-button" ng-click="controller.openChild()">pick one</button>
                        </div>
                    </dialog-content>
                    <dialog-footer>
                        <button class="c-button"
                                ng-click="controller.parentAnswerClick('Daddy')">Daddy
                        </button>
                        <button class="c-button"
                                ng-click="controller.parentAnswerClick('Mommy')">Mommy</button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>

        <div inv-popup="controller.popupChildConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="tiny"
                            dialog-title="'Which child is going?'"
                            dialog-type="content"
                            on-close="controller.closeChild()">
                    <dialog-content>
                        <button class="c-button c-button--primary"
                                ng-click="controller.childAnswerClick('Leslie')">Leslie</button>
                        <br>
                        <br>
                        <button class="c-button"
                                ng-click="controller.childAnswerClick('Tommy')">Tommy</button>
                        <br>
                    </dialog-content>
                    <dialog-footer>
                        <button class="c-button" ng-click="controller.closeChild()">Cancel</button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>
    </inv-popup-vault>
</div>

Non-Modal Popup

An example of a popup that is not a modal.

By setting the modal property to "false" in a popup's configuration, it would not be modal.

Answer: {{ controller.answer }}

Red blue or green? {{ controller.count }}
HTML
<div class="t-content c-content" ng-controller="nonModalExampleController as controller">
    <p>
        By setting the <code>modal</code> property to "false" in a popup's configuration,
        it would not be modal.
    </p>
    <p>
        <button class="c-button" ng-click="controller.openDialog()">Open</button>
    </p>
    <p>Answer: {{ controller.answer }}</p>

    <inv-popup-vault>
        <div inv-popup="controller.popupConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="small"
                            dialog-title="'Your API Choice?'"
                            dialog-type="content"
                            on-close="controller.closeDialog()">
                    <dialog-content>Red blue or green? {{ controller.count }}</dialog-content>
                    <dialog-footer>
                        <button class="c-button" ng-click="controller.answerClick('Red')">
                            Red
                        </button>
                        <button class="c-button" ng-click="controller.answerClick('Green')">
                            Green
                        </button>
                        <button class="c-button" ng-click="controller.answerClick('Blue')">
                            Blue
                        </button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>
    </inv-popup-vault>
</div>

Popup with Relative Container

An example of a popup with a non-body container, which is specified by using relative syntax.

A popup can also be scoped to a particular container so its blocker would only block the controls within the container.

The container can be specified by the container property in the popup's configuration. It can be a HTML element, an absolute query like '#myElement', or a relative query that looks like {{ controller.popupConfig.container }}.

A relative query is better scoped and can avoid naming collisions. Relative query syntax starts with $, and followed by traversal methods similar to jQuery, but restricted to support closest,   parent, and find.

 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tincidunt nibh tincidunt erat pretium, consectetur scelerisque arcu iaculis. In in ultrices tortor, sed sagittis lacus. Morbi ut tempor dolor, sed ullamcorper urna. Duis condimentum, eros quis varius gravida, ipsum velit luctus nulla, sed malesuada sapien quam ut urna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec diam metus, facilisis volutpat quam a, finibus aliquet est. Nam varius, elit vitae mattis dapibus, felis lorem luctus leo, vitae gravida urna erat quis sem. Praesent interdum suscipit dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

Ut in euismod arcu, eu mollis tortor. Curabitur ornare mattis interdum. Ut auctor, nulla id blandit tempus, tellus nisi volutpat lectus, molestie imperdiet tortor felis sed tortor. Ut et arcu purus. Aliquam dapibus arcu vestibulum, auctor dui nec, tincidunt odio. Nullam nisl leo, mollis sit amet tempus at, congue mattis nibh. Suspendisse potenti. Nullam efficitur, sapien sed sollicitudin porttitor, mauris nunc sodales nisi, et blandit dui orci ut risus. Fusce iaculis, tellus eget scelerisque finibus, est augue varius ligula, sed pretium lectus sapien et felis. Duis vitae odio euismod, elementum turpis ac, sollicitudin lacus. Quisque eros lorem, molestie vel interdum sit amet, rutrum ut neque. Integer velit tellus, sodales at nulla ut, sollicitudin maximus urna. Pellentesque egestas dapibus quam, eu tincidunt felis dapibus et. Aliquam eu purus feugiat, varius magna a, suscipit dui. Integer euismod, ipsum a rhoncus volutpat, lectus magna rutrum ante, pharetra sagittis diam massa sed velit.

HTML
<div class="g-popupExample t-content c-content" ng-controller="relativeContainerExampleController as controller">
    <p>
        A popup can also be scoped to a particular container so its blocker would
        only block the controls within the container.
    </p>
    <p>
        The container can be specified by the <code>container</code> property in
        the popup's configuration. It can be a HTML element, an absolute
        query like <code>'#myElement'</code>, or a relative query that looks like
        <code>{{ controller.popupConfig.container }}</code>.
    </p>
    <p>
        A relative query is better scoped and can avoid naming collisions. Relative
        query syntax starts with <code>$</code>, and followed by traversal methods
        similar to jQuery, but restricted to support <code>closest</code>,  
        <code>parent</code>, and <code>find</code>.
    </p>
    <p>
        <button class="c-button" ng-click="controller.openWait()">Open</button>
         
        <button class="c-button" ng-click="controller.closeWait()">Close</button>
    </p>

    <div class="g-popupExample-relativeContainer">
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque
            tincidunt nibh tincidunt erat pretium, consectetur scelerisque arcu
            iaculis. In in ultrices tortor, sed sagittis lacus. Morbi ut tempor
            dolor, sed ullamcorper urna. Duis condimentum, eros quis varius
            gravida, ipsum velit luctus nulla, sed malesuada sapien quam ut
            urna. Interdum et malesuada fames ac ante ipsum primis in faucibus.
            Donec diam metus, facilisis volutpat quam a, finibus aliquet est.
            Nam varius, elit vitae mattis dapibus, felis lorem luctus leo, vitae
            gravida urna erat quis sem. Praesent interdum suscipit dolor.
            Pellentesque habitant morbi tristique senectus et netus et malesuada
            fames ac turpis egestas.
        </p>
        <p>
            Ut in euismod arcu, eu mollis tortor. Curabitur ornare mattis
            interdum. Ut auctor, nulla id blandit tempus, tellus nisi volutpat
            lectus, molestie imperdiet tortor felis sed tortor. Ut et arcu
            purus. Aliquam dapibus arcu vestibulum, auctor dui nec, tincidunt
            odio. Nullam nisl leo, mollis sit amet tempus at, congue mattis
            nibh. Suspendisse potenti. Nullam efficitur, sapien sed sollicitudin
            porttitor, mauris nunc sodales nisi, et blandit dui orci ut risus.
            Fusce iaculis, tellus eget scelerisque finibus, est augue varius
            ligula, sed pretium lectus sapien et felis. Duis vitae odio euismod,
            elementum turpis ac, sollicitudin lacus. Quisque eros lorem,
            molestie vel interdum sit amet, rutrum ut neque. Integer velit
            tellus, sodales at nulla ut, sollicitudin maximus urna. Pellentesque
            egestas dapibus quam, eu tincidunt felis dapibus et. Aliquam eu
            purus feugiat, varius magna a, suscipit dui. Integer euismod, ipsum
            a rhoncus volutpat, lectus magna rutrum ante, pharetra sagittis diam
            massa sed velit.
        </p>
    </div>

    <inv-popup-vault>
        <div inv-popup="controller.popupConfig">
            <inv-loading-indicator is-loading="true" message="Please wait ..."></inv-loading-indicator>
        </div>
    </inv-popup-vault>
</div>

Popup via PopupManager (Instance-Based)

An example using the PopupManager without the use of the `inv-popup` directive.

A popup may be managed through a direct call to the PopupManager. This approach is only useful when the popup has to be declared purely with JavaScript, which should be a less common approach.

Ut in euismod arcu, eu mollis tortor. Curabitur ornare mattis interdum. Ut auctor, nulla id blandit tempus, tellus nisi volutpat lectus, molestie imperdiet tortor felis sed tortor. Ut et arcu purus. Aliquam dapibus arcu vestibulum, auctor dui nec, tincidunt odio. Nullam nisl leo, mollis sit amet tempus at, congue mattis nibh. Suspendisse potenti. Nullam efficitur, sapien sed sollicitudin porttitor, mauris nunc sodales nisi, et blandit dui orci ut risus. Fusce iaculis, tellus eget scelerisque finibus, est augue varius ligula, sed pretium lectus sapien et felis. Duis vitae odio euismod, elementum turpis ac, sollicitudin lacus. Quisque eros lorem, molestie vel interdum sit amet, rutrum ut neque. Integer velit tellus, sodales at nulla ut, sollicitudin maximus urna. Pellentesque egestas dapibus quam, eu tincidunt felis dapibus et. Aliquam eu purus feugiat, varius magna a, suscipit dui. Integer euismod, ipsum a rhoncus volutpat, lectus magna rutrum ante, pharetra sagittis diam massa sed velit.

Please wait ...
HTML
<div class="g-popupExample t-content c-content"
     ng-controller="nonDirectivePopupExampleController as controller">
    <p>
        A popup may be managed through a direct call to the PopupManager.
        This approach is only useful when the popup has to be declared purely with JavaScript,
        which should be a less common approach.
    </p>
    <p>
        <button class="c-button" ng-click="controller.openWait()">Open</button>
    </p>

    <div id="nonDirectiveExamplePopupContainer"
         class="g-popupExample-relativeContainer">
        <p>
            Ut in euismod arcu, eu mollis tortor. Curabitur ornare mattis
            interdum. Ut auctor, nulla id blandit tempus, tellus nisi volutpat
            lectus, molestie imperdiet tortor felis sed tortor. Ut et arcu
            purus. Aliquam dapibus arcu vestibulum, auctor dui nec, tincidunt
            odio. Nullam nisl leo, mollis sit amet tempus at, congue mattis
            nibh. Suspendisse potenti. Nullam efficitur, sapien sed sollicitudin
            porttitor, mauris nunc sodales nisi, et blandit dui orci ut risus.
            Fusce iaculis, tellus eget scelerisque finibus, est augue varius
            ligula, sed pretium lectus sapien et felis. Duis vitae odio euismod,
            elementum turpis ac, sollicitudin lacus. Quisque eros lorem,
            molestie vel interdum sit amet, rutrum ut neque. Integer velit
            tellus, sodales at nulla ut, sollicitudin maximus urna. Pellentesque
            egestas dapibus quam, eu tincidunt felis dapibus et. Aliquam eu
            purus feugiat, varius magna a, suscipit dui. Integer euismod, ipsum
            a rhoncus volutpat, lectus magna rutrum ante, pharetra sagittis diam
            massa sed velit.
        </p>
    </div>

    <inv-popup-vault>
        <div inv-popup="controller.popupConfig">

            <!-- NOTE: This use case shouldn't wrap the popup's contents in a `ng-if` since it's targeting the DOM element that needs to exist -->
            <div id="nonDirectiveExamplePopupTarget"
                 class="g-popupExample-wait">
                <div class="c-loadingIndicator-containment">
                    <inv-loading-indicator is-loading="true"></inv-loading-indicator>
                </div>
                Please wait ...
                <button class="c-button" ng-click="controller.closeWait()">Stop, I am impatient!</button>
            </div>
        </div>
    </inv-popup-vault>
</div>

Popup via PopupManager (Template-Based)

An example using the PopupManager without the use of the `inv-popup` directive and an external template for its contents.

A popup may be managed through a direct call to the PopupManager and its contents defined in an external template. This approach is the least recommended because the template/controller dependencies are a lot less apparent.

Ut in euismod arcu, eu mollis tortor. Curabitur ornare mattis interdum. Ut auctor, nulla id blandit tempus, tellus nisi volutpat lectus, molestie imperdiet tortor felis sed tortor. Ut et arcu purus. Aliquam dapibus arcu vestibulum, auctor dui nec, tincidunt odio. Nullam nisl leo, mollis sit amet tempus at, congue mattis nibh. Suspendisse potenti. Nullam efficitur, sapien sed sollicitudin porttitor, mauris nunc sodales nisi, et blandit dui orci ut risus. Fusce iaculis, tellus eget scelerisque finibus, est augue varius ligula, sed pretium lectus sapien et felis. Duis vitae odio euismod, elementum turpis ac, sollicitudin lacus. Quisque eros lorem, molestie vel interdum sit amet, rutrum ut neque. Integer velit tellus, sodales at nulla ut, sollicitudin maximus urna. Pellentesque egestas dapibus quam, eu tincidunt felis dapibus et. Aliquam eu purus feugiat, varius magna a, suscipit dui. Integer euismod, ipsum a rhoncus volutpat, lectus magna rutrum ante, pharetra sagittis diam massa sed velit.

HTML
<div class="g-popupExample t-content c-content"
     ng-controller="templateBasePopupExampleController as controller">
    <p>
        A popup may be managed through a direct call to the PopupManager and
        its contents defined in an external template. This approach is the least recommended
        because the template/controller dependencies are a lot less apparent.
    </p>
    <p>
        <button class="c-button" ng-click="controller.openWait()">Open</button>
    </p>

    <div id="templateBasePopupContainer"
         class="g-popupExample-relativeContainer"
         style="background-color: #ececef; color: #332211;">
        <p>
            Ut in euismod arcu, eu mollis tortor. Curabitur ornare mattis
            interdum. Ut auctor, nulla id blandit tempus, tellus nisi volutpat
            lectus, molestie imperdiet tortor felis sed tortor. Ut et arcu
            purus. Aliquam dapibus arcu vestibulum, auctor dui nec, tincidunt
            odio. Nullam nisl leo, mollis sit amet tempus at, congue mattis
            nibh. Suspendisse potenti. Nullam efficitur, sapien sed sollicitudin
            porttitor, mauris nunc sodales nisi, et blandit dui orci ut risus.
            Fusce iaculis, tellus eget scelerisque finibus, est augue varius
            ligula, sed pretium lectus sapien et felis. Duis vitae odio euismod,
            elementum turpis ac, sollicitudin lacus. Quisque eros lorem,
            molestie vel interdum sit amet, rutrum ut neque. Integer velit
            tellus, sodales at nulla ut, sollicitudin maximus urna. Pellentesque
            egestas dapibus quam, eu tincidunt felis dapibus et. Aliquam eu
            purus feugiat, varius magna a, suscipit dui. Integer euismod, ipsum
            a rhoncus volutpat, lectus magna rutrum ante, pharetra sagittis diam
            massa sed velit.
        </p>
    </div>
</div>

Popup with Close All Button

An example of closing all popups.

All open popups may be closed from any place by clicking on the "Close All" button. This is achieved by calling $popupManager.closeAll().

 

 

Another popup! Choose Close All or Close This.
HTML
<div class="t-content c-content" ng-controller="popupCloseAllExampleController as controller">
    <p>
        All open popups may be closed from any place by clicking on the "Close All" button.
        This is achieved by calling <code>$popupManager.closeAll()</code>.
    </p>
    <p>
        <button class="c-button" ng-click="controller.openParent()">Open the first Modal</button>
    </p>

    <inv-popup-vault>
        <div inv-popup="controller.popupParentConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="medium"
                            dialog-title="'Which parent is going?'"
                            dialog-type="content"
                            on-close="controller.closeParent()">
                    <dialog-content>
                            <p> </p>
                            <p> </p>
                            <p>
                                <button class="c-button" ng-click="controller.openChild()">Open another Modal</button>
                            </p>
                    </dialog-content>
                    <dialog-footer>
                        <button class="c-button" ng-click="controller.closeAll()">Close All</button>
                        <button class="c-button" ng-click="controller.closeParent()">Close This</button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>

        <div inv-popup="controller.popupChildConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="small"
                            dialog-title="'Which child is going?'"
                            dialog-type="content"
                            on-close="controller.closeChild()">
                    <dialog-content>
                        Another popup!  Choose Close All or Close This.
                    </dialog-content>
                    <dialog-footer>
                        <button class="c-button" ng-click="controller.closeAll()">Close All</button>
                        <button class="c-button" ng-click="controller.closeChild()">Close This</button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>
    </inv-popup-vault>
</div>

Popup X-Ray

An example of x-raying into a popup vault and seeing the popup's contents at rest.

This example provides "X-ray vision", which shows the contents of the popup while it's at rest. In that state, all watchers are disabled for performance reasons. They can be manually turned on/off through calling the enableWatchers() and disableWatchers() in the API.

Answer: {{ controller.answer }}

Red blue or green? {{ controller.count }}
HTML
<div class="t-content c-content" ng-controller="basicPopupApiExampleController as controller">
    <p>
        This example provides "X-ray vision", which shows the contents of the popup while
        it's at rest. In that state, all watchers are disabled for performance reasons.
        They can be manually turned on/off through calling the <code>enableWatchers()</code>
        and <code>disableWatchers()</code> in the API.
    </p>
    <p>
        <button class="c-button" ng-click="controller.openDialog()">Open</button>
    </p>
    <p>Answer: {{ controller.answer }}</p>

    <inv-popup-vault style="display: block; opacity: 0.2;">
        <div inv-popup="controller.popupConfig">
            <div ng-if="true">
                <inv-dialog dialog-size="small"
                            dialog-title="'Your API Choice?'"
                            dialog-type="content"
                            on-close="controller.closeDialog()">
                    <dialog-content>Red blue or green? {{ controller.count }}</dialog-content>
                    <dialog-footer>
                        <button class="c-button" ng-click="controller.answerClick('Red')">
                            Red
                        </button>
                        <button class="c-button" ng-click="controller.answerClick('Green')">
                            Green
                        </button>
                        <button class="c-button" ng-click="controller.answerClick('Blue')">
                            Blue
                        </button>
                    </dialog-footer>
                </inv-dialog>
            </div>
        </div>
    </inv-popup-vault>
</div>