Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from htreu/master

Adding zIndex as a property of the ZeroClipboard object

> Hi Jon,
> 
> I am using ZeroClipboard for a new (private) vaadin addon which provides
> copy to clipboard as a simple Button widget. During integration I had to
> apply small changes to the ZeroClipboard.js to allow JSNI calls from
> Java. Another change regards to the zIndex. I had to made it a property
> of the Client since vaadin popups have a zIndex of 20000. Please find
> the patch attached.
> Another question regarding usage of ZeroClipboard: I would like to make
> my addon available to the public and add it to the vaadin addon
> directory. Please let me know your opinion about it.
> 
> 
> I would be happy hearing from you. Cheers.
> Henning
  • Loading branch information...
commit 03994537d40757549c8c7a867b5578f0746d55e4 2 parents afac816 + 1193975
@jonrohan jonrohan authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 ZeroClipboard.js
View
13 ZeroClipboard.js
@@ -40,6 +40,11 @@ var ZeroClipboard = {
this.moviePath = path;
},
+ // use this method in JSNI calls to obtain a new Client instance
+ newClient: function() {
+ return new ZeroClipboard.Client();
+ },
+
dispatch: function(id, eventName, args) {
// receive event from flash movie, send to client
var client = this.clients[id];
@@ -96,16 +101,16 @@ ZeroClipboard.Client.prototype = {
handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
cssEffects: true, // enable CSS mouse effects on dom container
handlers: null, // user event handlers
+ zIndex: 99, // default zIndex of the movie object
glue: function(elem, appendElem, stylesToAdd) {
// glue to DOM element
// elem can be ID or actual DOM element object
this.domElement = ZeroClipboard.$(elem);
- // float just above object, or zIndex 99 if dom element isn't set
- var zIndex = 99;
+ // float just above object, or default zIndex if dom element isn't set
if (this.domElement.style.zIndex) {
- zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
+ this.zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}
if (typeof(appendElem) == 'string') {
@@ -126,7 +131,7 @@ ZeroClipboard.Client.prototype = {
style.top = '' + box.top + 'px';
style.width = '' + box.width + 'px';
style.height = '' + box.height + 'px';
- style.zIndex = zIndex;
+ style.zIndex = this.zIndex;
if (typeof(stylesToAdd) == 'object') {
for (addedStyle in stylesToAdd) {
Please sign in to comment.
Something went wrong with that request. Please try again.