Skip to content

Commit

Permalink
Fix tip position when tour targeted element has fixed css position
Browse files Browse the repository at this point in the history
  • Loading branch information
azizmashkour committed Sep 26, 2017
1 parent ac92287 commit 642c739
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build/js/bootstrap-tour-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,9 @@
}).popover('show');
$tip = $element.data('bs.popover') ? $element.data('bs.popover').tip() : $element.data('popover').tip();
$tip.attr('id', step.id);
if ($element.css('position' === 'fixed')) {
$tip.css('position', 'fixed');
}
this._focus($tip, $element, step.next < 0);
this._reposition($tip, step);
if (isOrphan) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour-standalone.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions build/js/bootstrap-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@
}).popover('show');
$tip = $element.data('bs.popover') ? $element.data('bs.popover').tip() : $element.data('popover').tip();
$tip.attr('id', step.id);
if ($element.css('position' === 'fixed')) {
$tip.css('position', 'fixed');
}
this._focus($tip, $element, step.next < 0);
this._reposition($tip, step);
if (isOrphan) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/bootstrap-tour.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/coffee/bootstrap-tour.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@
# Tip adjustment
$tip = if $element.data 'bs.popover' then $element.data('bs.popover').tip() else $element.data('popover').tip()
$tip.attr 'id', step.id
$tip.css 'position', 'fixed' if $element.css 'position' is 'fixed'

@_focus $tip, $element, step.next < 0
@_reposition $tip, step
Expand Down
3 changes: 3 additions & 0 deletions src/docs/assets/js/bootstrap-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@
}).popover('show');
$tip = $element.data('bs.popover') ? $element.data('bs.popover').tip() : $element.data('popover').tip();
$tip.attr('id', step.id);
if ($element.css('position' === 'fixed')) {
$tip.css('position', 'fixed');
}
this._focus($tip, $element, step.next < 0);
this._reposition($tip, step);
if (isOrphan) {
Expand Down
3 changes: 3 additions & 0 deletions test/bootstrap-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@
}).popover('show');
$tip = $element.data('bs.popover') ? $element.data('bs.popover').tip() : $element.data('popover').tip();
$tip.attr('id', step.id);
if ($element.css('position' === 'fixed')) {
$tip.css('position', 'fixed');
}
this._focus($tip, $element, step.next < 0);
this._reposition($tip, step);
if (isOrphan) {
Expand Down

0 comments on commit 642c739

Please sign in to comment.