Support » Plugin: WordPress MooTools Tree Creator » Attach PDFs?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author aryanduntley

    (@dunar21)

    Sorry, I did not respond right away, I would have thought these questions would be directed to my email. Anyway, the answer to your questions is all in the javascript.

    The mootree library comes with several event handlers. The documentation is located in Settings>WP MooTree>Categories(tab)>under “Customize Javascript” bullet point.

    The event handler being used is the onSelect. In order to open a url instead of an image, you can simply remove the milkbox call and replace it with a simple javascript call to window.open.

    The url that you place into the specific branch is accessed by way of node.data.url. Other relevant data access calls are listed in the documentation.

    So, to change the javascript to fit your purpose, simply locate this function relative to the specific tree category you wish to apply the new functionality:

    onSelect: function(node, state) {
    if (state){
    if(typeof(node.data.url) ==  "string" && node.data.url != "" ){
      //HERE IS WHERE YOU WOULD PUT YOUR CODE FOR THIS ONSELECT FUNCTION
     //maybe something like this: window.open(node.data.url,'_blank');
    }}}

    That’s it. Hope this helps.

    Excellent! Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Attach PDFs?’ is closed to new replies.