angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.27k stars 6.73k forks source link

feat(position): add 'positionElementAt' method #6339

Open farooqu opened 7 years ago

farooqu commented 7 years ago

Add a method to position an element at client x/y coordinates. Using code from the positionElements method, which has been refactored into a positionElement method with both positionElementAt and positionElements use.

farooqu commented 7 years ago

I'm creating a context menu directive, and was wanting to use the same positioning logic as all of the bootstrap elements we use.

wesleycho commented 7 years ago

I'm not sure I see the value of this in the library itself - it doesn't appear like something anything in UI Bootstrap would use.

In addition, this appears to be wholly independent code - one could just create a wrapper around the UI Bootstrap $uibPosition service and add this method to the wrapper, or decorate it with $provide.decorator. There are lots of ways to place it in one's application that doesn't require shipping code that is unused for most users.