Skip to content

Commit

Permalink
Merge pull request shipshapecode#273 from HubSpot/fix-reappend-to-bod…
Browse files Browse the repository at this point in the history
…y-element

Fix bug where Tether would be re-appended to same parent on update
  • Loading branch information
TrevorBurnham authored Nov 8, 2017
2 parents d46b391 + 43e815e commit 39708c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/js/tether.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ var position = function position() {
};

function now() {
if (typeof performance !== 'undefined' && typeof performance.now !== 'undefined') {
if (performance && performance.now) {
return performance.now();
}
return +new Date();
Expand Down Expand Up @@ -1248,7 +1248,9 @@ var TetherClass = (function (_Evented) {

if (!moved) {
if (this.options.bodyElement) {
this.options.bodyElement.appendChild(this.element);
if (this.element.parentNode !== this.options.bodyElement) {
this.options.bodyElement.appendChild(this.element);
}
} else {
var offsetParentIsBody = true;
var currentNode = this.element.parentNode;
Expand Down
Loading

0 comments on commit 39708c4

Please sign in to comment.