Skip to content

Commit

Permalink
Fix bug in tooltip position calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
terrill committed Feb 27, 2020
1 parent 51fdbd8 commit df38936
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
5 changes: 2 additions & 3 deletions build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4304,14 +4304,13 @@ var AblePlayerInstances = [];
var position = $(this).position();
var buttonHeight = $(this).height();
var buttonWidth = $(this).width();

// position() is expressed using top and left (of button);
// add right (of button) too, for convenience
var controllerWidth = thisObj.$controllerDiv.width();
position.right = controllerWidth - position.left - buttonWidth;

var tooltipY = position.top - buttonHeight - 15;
if ($(this).closest('div').hasClass('able-right-controls')) {

if ($(this).parent().hasClass('able-right-controls')) {
// this control is on the right side
var buttonSide = 'right';
}
Expand Down
5 changes: 2 additions & 3 deletions build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4304,14 +4304,13 @@ var AblePlayerInstances = [];
var position = $(this).position();
var buttonHeight = $(this).height();
var buttonWidth = $(this).width();

// position() is expressed using top and left (of button);
// add right (of button) too, for convenience
var controllerWidth = thisObj.$controllerDiv.width();
position.right = controllerWidth - position.left - buttonWidth;

var tooltipY = position.top - buttonHeight - 15;
if ($(this).closest('div').hasClass('able-right-controls')) {

if ($(this).parent().hasClass('able-right-controls')) {
// this control is on the right side
var buttonSide = 'right';
}
Expand Down
4 changes: 2 additions & 2 deletions build/ableplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ableplayer",
"version": "4.2.18",
"version": "4.2.19",
"description": "fully accessible HTML5 media player",
"homepage": "http://ableplayer.github.io/ableplayer",
"bugs": "https://github.com/ableplayer/ableplayer/issues",
Expand Down
5 changes: 2 additions & 3 deletions scripts/buildplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1250,14 +1250,13 @@
var position = $(this).position();
var buttonHeight = $(this).height();
var buttonWidth = $(this).width();

// position() is expressed using top and left (of button);
// add right (of button) too, for convenience
var controllerWidth = thisObj.$controllerDiv.width();
position.right = controllerWidth - position.left - buttonWidth;

var tooltipY = position.top - buttonHeight - 15;
if ($(this).closest('div').hasClass('able-right-controls')) {

if ($(this).parent().hasClass('able-right-controls')) {
// this control is on the right side
var buttonSide = 'right';
}
Expand Down

0 comments on commit df38936

Please sign in to comment.