Skip to content

Commit

Permalink
Merge pull request #5 from dominicbarnes/append-elem-show-fix
Browse files Browse the repository at this point in the history
Correcting repositioning issue after hiding clipboard embed
  • Loading branch information
dominicbarnes committed Jun 16, 2014
2 parents 4735402 + 911026e commit 8022f3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -138,6 +138,8 @@ Client.prototype.render = function(elem, appendElem) {
appendElem = document.getElementsByTagName('body')[0];
}

this.appendElement = appendElem;

// find X/Y position of domElement
var box = getDOMObjectPosition(this.domElement, appendElem);

Expand Down Expand Up @@ -225,7 +227,7 @@ Client.prototype.reposition = function(elem){
}

if (this.domElement && this.div) {
var box = getDOMObjectPosition(this.domElement);
var box = getDOMObjectPosition(this.domElement, this.appendElement);
var style = this.div.style;
style.left = '' + box.left + 'px';
style.top = '' + box.top + 'px';
Expand Down

0 comments on commit 8022f3b

Please sign in to comment.