Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
If there is no currentElement return from reposition #51
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Dec 28, 2012
1 parent fa6155b commit 1e70c3c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions ZeroClipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
}
};
ZeroClipboard.Client.prototype.reposition = function() {
if (!ZeroClipboard.currentElement) return false;
var pos = ZeroClipboard.getDOMObjectPosition(ZeroClipboard.currentElement);
this.htmlBridge.style.top = pos.top + "px";
this.htmlBridge.style.left = pos.left + "px";
Expand Down
2 changes: 1 addition & 1 deletion ZeroClipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This release re-writes a lot of how zeroclipboard client works. Check the docs f
* [FEATURE] Register more than one event `.on("load complete", function() {})`
* [FEATURE] Event handlers can now access the clicked element via `this`
* [BUG] When creating more than one clip, the second clip doesn't glue.
* [BUG] If there is no currentElement return from reposition #51

### ZeroClipboard 1.0.9

Expand Down
4 changes: 4 additions & 0 deletions src/javascript/ZeroClipboard/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ ZeroClipboard.Client.prototype.setCurrent = function (element) {
* returns nothing
*/
ZeroClipboard.Client.prototype.reposition = function () {

// If there is no currentElement return
if (!ZeroClipboard.currentElement) return false;

var pos = ZeroClipboard.getDOMObjectPosition(ZeroClipboard.currentElement);

// new css
Expand Down

0 comments on commit 1e70c3c

Please sign in to comment.