AnsweredAssumed Answered

Add event listener to custom action

Question asked by michaelp on Feb 17, 2015
Latest reply on Feb 20, 2015 by michaelp
Hi guys,

I am looking for the right javascript file in which the actions are created for each node presented in the document library.

What I want to do: for each action "custom copy" on the document library I want to add an event listener like:


var newEventListenerX = new zcProto(YUI-ID, record.jsNode.nodeRef);

// Prototype
function zcProto(id, link) {
   this.id = id;
   this.link = link;
   var zclip = new ZeroClipboard(document.getElementById(id));
   zclip.on("ready", function() {
      zclip.on("aftercopy", function(event) {
      });
   });
   zclip.on("copy", function (event) {
      var clipboard = event.clipboardData;
      clipboard.setData("text/plain", link);
   });
}


The listeners should always be unique because on every node the "custom copy" action should copy another string (like the nodeRef of the node).

Can someone tell me the right place where I can add the listeners during the loading process of the html site?

Thank you all in advance!

Outcomes