How do I open a modal inside a modal with a suitable background with angular framework?

I would like to open a modal inside a modal background with a background - backdrop -> window -> backdrop -> window

How can I achieve this using angular framework?

http://madmimi.github.io/angular-foundation/

thank!

+3


source to share


2 answers


angular-foundation does not support modality inside another modal. The z-index values ​​are hardcoded.

There is a solution that replaces the modal, but that doesn't work for us. http://foundation.zurb.com/docs/components/reveal.html

I have applied the directive for this (typescript) -



export function ModalPositionHelper($modalStack):ng.IDirective {
    var initialModalZIndex = 1005;
    return {
        restrict: 'A',
        link: function (scope) {
            scope.$watch(function () {
                return $modalStack.getTop();
            }, function (newModal, oldModal) {
                if (oldModal) {
                    oldModal.value.modalDomEl.css('z-index', initialModalZIndex);
                }
                if (newModal) {
                    newModal.value.modalDomEl.css('z-index', initialModalZIndex + 2);
                    angular.element('.reveal-modal-bg').css('z-index', initialModalZIndex + 1);
                }
            });
        }
    };
}

      

Basically I look at $ modalStack.getTop () and change its z-index.

+1


source


There is no good user experience that can result from this. Redefining your approach would be better than two-mode. Some fixes are not related to the code.



0


source







All Articles