Permalink
Browse files

if the element has a title tag, then it sets the title

  • Loading branch information...
1 parent 8f482c0 commit 80bd2aa2559981bb4ade616997b667d0aa7ac7eb @jonrohan jonrohan committed Sep 25, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/javascript/ZeroClipboard.js
@@ -97,7 +97,7 @@ window.ZeroClipboard = {
ZeroClipboard.Client.prototype = {
id: 0, // unique ID for us
- title: "", // tooltip for the flash element
+ title: "", // tooltip for the flash element
ready: false, // whether movie is ready to receive events or not
movie: null, // reference to movie object
clipText: '', // text to copy to clipboard
@@ -116,6 +116,11 @@ ZeroClipboard.Client.prototype = {
this.zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}
+ // check if the element has a title
+ if (this.domElement.getAttribute("title") != null) {
+ this.title = this.domElement.getAttribute("title");
+ }
+
if (typeof(appendElem) == 'string') {
appendElem = ZeroClipboard.$(appendElem);
}
@@ -218,7 +223,7 @@ ZeroClipboard.Client.prototype = {
},
setTitle: function(newTitle) {
- // set text to be copied to clipboard
+ // set title of flash element
this.title = newTitle;
if (this.ready) this.movie.setTitle(newTitle);
},

0 comments on commit 80bd2aa

Please sign in to comment.