Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Option to display only one popover at a time #749

Closed
wants to merge 9 commits into from
Closed

Option to display only one popover at a time #749

wants to merge 9 commits into from

Conversation

vchatterji
Copy link

See issues:
#618
and
#590

This feature allows for a single popover being displayed. Any new popover will close any older popovers. Clicking on body will also close the popover. The behaviour is optional and by default the popover will retain its existing multiple display functionality.

This feature can be turned on via:
$tooltipProvider.options({ popoverMode: 'single'});

varun added 4 commits August 3, 2013 22:12
Added a new option for popoverMode. If set to single, only one popover
will be displayed at a time. Clicking elsewhere in the body or another
popover will hide the previous popover. This functionality is ideal for
tablets where mouseneter and mouseleave are not ideal.
@pkozlowski-opensource
Copy link
Member

@vchatterji #692 was already fixed in master

This reverts commit 4970ae6.
@vchatterji
Copy link
Author

Reverted 692 changes.

Moved the check to before link as it only needs to be executed once
@vchatterji
Copy link
Author

Created a working plunk with this code (also checked it works with bootstrap 3):
http://plnkr.co/edit/fHl8lT?p=preview

@pkozlowski-opensource
Copy link
Member

@vchatterji could you please squash all the commits into one - it is very hard to review it currently.

As the very quick note - I'm a bit worried about the amount of code this change adds... I think it would be much easier / shorter to create a new directive (popver-group?) with a controller. Then popovers could require this controller and the whole logic in a controller could make sure that tooltips / popovers are closed as needed. DOM-scanning could be done by AngularJS then and we wouldn't have to hard-code it.

As a general rule I would expect that this change doesn't add more than 10LOC or something...

@vchatterji vchatterji closed this Aug 3, 2013
@vchatterji
Copy link
Author

I will open another pull request with a single commit

@tmundt
Copy link

tmundt commented Mar 22, 2014

Is this feature implemented into the offical popover of angularJS?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants