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

Commit

Permalink
fix(tooltip): remove placement='mouse' option
Browse files Browse the repository at this point in the history
Closes #832

BREAKING CHANGE:

The placment='mouse' is gone with no equivalent
  • Loading branch information
pkozlowski-opensource committed Aug 17, 2013
1 parent ed3700b commit 17163c2
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/popover/docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ <h4>Positional</h4>
<button popover-placement="left" popover="On the Left!" class="btn">Left</button>
<button popover-placement="right" popover="On the Right!" class="btn">Right</button>
<button popover-placement="bottom" popover="On the Bottom!" class="btn">Bottom</button>
<button popover-placement="mouse" popover="relative to mouse" class="btn">Mouse</button>
</div>
<div>
<h4>Triggers</h4>
Expand Down
2 changes: 1 addition & 1 deletion src/popover/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ will display:

- `popover-title`: A string to display as a fancy title.
- `popover-placement`: Where to place it? Defaults to "top", but also accepts
"bottom", "left", "right", or "mouse".
"bottom", "left", "right".
- `popover-animation`: Should it fade in and out? Defaults to "true".
- `popover-popup-delay`: For how long should the user have to have the mouse
over the element before the popover shows (in milliseconds)? Defaults to 0.
Expand Down
14 changes: 0 additions & 14 deletions src/position/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ angular.module('ui.bootstrap.position', [])
*/
.factory('$position', ['$document', '$window', function ($document, $window) {

var mouseX, mouseY;

$document.bind('mousemove', function mouseMoved(event) {
mouseX = event.pageX;
mouseY = event.pageY;
});

function getStyle(el, cssprop) {
if (el.currentStyle) { //IE
return el.currentStyle[cssprop];
Expand Down Expand Up @@ -81,13 +74,6 @@ angular.module('ui.bootstrap.position', [])
top: boundingClientRect.top + ($window.pageYOffset || $document[0].body.scrollTop),
left: boundingClientRect.left + ($window.pageXOffset || $document[0].body.scrollLeft)
};
},

/**
* Provides the coordinates of the mouse
*/
mouse: function () {
return {x: mouseX, y: mouseY};
}
};
}]);
4 changes: 1 addition & 3 deletions src/tooltip/docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
nunc sed velit dignissim sodales ut eu sem integer vitae. Turpis egestas
<a><span tooltip-placement="bottom" tooltip="On the Bottom!">bottom</span></a>
pharetra convallis posuere morbi leo urna,
<a><span tooltip-placement="mouse" tooltip="relative to mouse">mouse</span></a>
blah blah blah,
<a><span tooltip-animation="false" tooltip="I don't fade. :-(">fading</span></a>
<a><span tooltip-animation="false" tooltip="I don't fade. :-(">fading</span></a>
at elementum eu, facilisis sed odio morbi quis commodo odio. In cursus
<a><span tooltip-popup-delay='1000' tooltip='appears with delay'>delayed</span></a> turpis massa tincidunt dui ut.
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/tooltip/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The tooltip directives provide several optional attributes to control how they
will display:

- `tooltip-placement`: Where to place it? Defaults to "top", but also accepts
"bottom", "left", "right", or "mouse".
"bottom", "left", "right".
- `tooltip-animation`: Should it fade in and out? Defaults to "true".
- `tooltip-popup-delay`: For how long should the user have to have the mouse
over the element before the tooltip shows (in milliseconds)? Defaults to 0.
Expand Down
7 changes: 0 additions & 7 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
// Calculate the tooltip's top and left coordinates to center it with
// this directive.
switch ( scope.tt_placement ) {
case 'mouse':
var mousePos = $position.mouse();
ttPosition = {
top: mousePos.y,
left: mousePos.x
};
break;
case 'right':
ttPosition = {
top: position.top + position.height / 2 - ttHeight / 2,
Expand Down

0 comments on commit 17163c2

Please sign in to comment.