Add callbacks for when a popover is opened or closed. #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, it appears that there are two ways to hook into the opening of a popover.
ns-popover-angular-event
, which will open the popover when the given event name is broadcasted on the$rootScope
. You can listen to that event elsewhere and know that when it is called, the popover was also told to display.ns-popover-scope-event
, which will open the popover when the given event name is broadcasted on the$scope
. As withangular-event
, you can listen for that event and respond accordingly.The problem with the two approaches above is that sometimes there are many popovers on the same scope, so unless you are using group ids, you may be triggering numerous popovers to display when you had only wanted to open one.
To remedy this, both
ns-popover-angular-event
andns-popover-scope-event
should parse the passed in values, so that you could bind to an event such assome:event:{{ some.id }}
.I found that this was a level of complexity that was beyond what I was looking to do.
Really, I just wanted to run callback methods when the associated popover was either opened or closed.
These proposed changes introduce the following attributes:
The callbacks will be executed when the respective popover's
displayer_.display
orhider_.hide
methods are called.