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

Commit 17163c2

Browse files
fix(tooltip): remove placement='mouse' option
Closes #832 BREAKING CHANGE: The placment='mouse' is gone with no equivalent
1 parent ed3700b commit 17163c2

File tree

6 files changed

+3
-27
lines changed

6 files changed

+3
-27
lines changed

src/popover/docs/demo.html

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ <h4>Positional</h4>
1313
<button popover-placement="left" popover="On the Left!" class="btn">Left</button>
1414
<button popover-placement="right" popover="On the Right!" class="btn">Right</button>
1515
<button popover-placement="bottom" popover="On the Bottom!" class="btn">Bottom</button>
16-
<button popover-placement="mouse" popover="relative to mouse" class="btn">Mouse</button>
1716
</div>
1817
<div>
1918
<h4>Triggers</h4>

src/popover/docs/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ will display:
99

1010
- `popover-title`: A string to display as a fancy title.
1111
- `popover-placement`: Where to place it? Defaults to "top", but also accepts
12-
"bottom", "left", "right", or "mouse".
12+
"bottom", "left", "right".
1313
- `popover-animation`: Should it fade in and out? Defaults to "true".
1414
- `popover-popup-delay`: For how long should the user have to have the mouse
1515
over the element before the popover shows (in milliseconds)? Defaults to 0.

src/position/position.js

-14
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ angular.module('ui.bootstrap.position', [])
88
*/
99
.factory('$position', ['$document', '$window', function ($document, $window) {
1010

11-
var mouseX, mouseY;
12-
13-
$document.bind('mousemove', function mouseMoved(event) {
14-
mouseX = event.pageX;
15-
mouseY = event.pageY;
16-
});
17-
1811
function getStyle(el, cssprop) {
1912
if (el.currentStyle) { //IE
2013
return el.currentStyle[cssprop];
@@ -81,13 +74,6 @@ angular.module('ui.bootstrap.position', [])
8174
top: boundingClientRect.top + ($window.pageYOffset || $document[0].body.scrollTop),
8275
left: boundingClientRect.left + ($window.pageXOffset || $document[0].body.scrollLeft)
8376
};
84-
},
85-
86-
/**
87-
* Provides the coordinates of the mouse
88-
*/
89-
mouse: function () {
90-
return {x: mouseX, y: mouseY};
9177
}
9278
};
9379
}]);

src/tooltip/docs/demo.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
nunc sed velit dignissim sodales ut eu sem integer vitae. Turpis egestas
1313
<a><span tooltip-placement="bottom" tooltip="On the Bottom!">bottom</span></a>
1414
pharetra convallis posuere morbi leo urna,
15-
<a><span tooltip-placement="mouse" tooltip="relative to mouse">mouse</span></a>
16-
blah blah blah,
17-
<a><span tooltip-animation="false" tooltip="I don't fade. :-(">fading</span></a>
15+
<a><span tooltip-animation="false" tooltip="I don't fade. :-(">fading</span></a>
1816
at elementum eu, facilisis sed odio morbi quis commodo odio. In cursus
1917
<a><span tooltip-popup-delay='1000' tooltip='appears with delay'>delayed</span></a> turpis massa tincidunt dui ut.
2018
</p>

src/tooltip/docs/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The tooltip directives provide several optional attributes to control how they
1111
will display:
1212

1313
- `tooltip-placement`: Where to place it? Defaults to "top", but also accepts
14-
"bottom", "left", "right", or "mouse".
14+
"bottom", "left", "right".
1515
- `tooltip-animation`: Should it fade in and out? Defaults to "true".
1616
- `tooltip-popup-delay`: For how long should the user have to have the mouse
1717
over the element before the tooltip shows (in milliseconds)? Defaults to 0.

src/tooltip/tooltip.js

-7
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,6 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
184184
// Calculate the tooltip's top and left coordinates to center it with
185185
// this directive.
186186
switch ( scope.tt_placement ) {
187-
case 'mouse':
188-
var mousePos = $position.mouse();
189-
ttPosition = {
190-
top: mousePos.y,
191-
left: mousePos.x
192-
};
193-
break;
194187
case 'right':
195188
ttPosition = {
196189
top: position.top + position.height / 2 - ttHeight / 2,

0 commit comments

Comments
 (0)