btford / angular-modal

Simple AngularJS service for creating modals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Before / After hook for events before/after activate/deactivate

phillip-haydon opened this issue · comments

Throwing an idea out there:

I would like to be able to do something along the lines of:

    angular.module('MyApp')
        .factory('libraryModal', function(btfModal) {
            return btfModal({
                controller: '...',
                controllerAs: 'modal',
                templateUrl: '...',
                beforeActivate: function() {
                    ....
                },
                afterDeactivate: function() {
                    ....
                }
            });
        });

The scenario I have is when I go full screen I want to do two things:

  1. Hide scroll bars on the body of the document
  2. Hide thumb videos that display in the UI (QuickTime seems to sit on top of everything)

Because these are mostly UI changes I figured I don't want to do this in the controllers so this would be a good solution.

Thoughts?

Why not write your own service to wrap the modal factory and add this feature?

Because I honestly did not think of that, and it makes perfect sense...

Done, works great, thanks a lot! :D

Might write up a blog post for this.