Forums

WP-dTree
set the icons on the right (8 posts)

  1. weirdrubikscube
    Member
    Posted 8 months ago #

    Hi there,

    I wanted to align my menu on the right so I modify the css to do so

    but the icons and empty gifs are still on the left and I would like them to be on the right (I'm actually only using empty gifs)

    what should I do in wp-dtree.min.js to make this happen ?

    I tried to mess around but could not achieve my goal

    any help is very welcome :)

    thanks !

    http://wordpress.org/extend/plugins/wp-dtree-30/

  2. ulfben
    Member
    Posted 8 months ago #

    You never work with the minified javascript (.min.js). Edit the PHP to load the human-readable one and work in that instead.

    Good luck!

  3. weirdrubikscube
    Member
    Posted 8 months ago #

    thanks for the clear up !

    which php file should I try to modify ?

  4. ulfben
    Member
    Posted 8 months ago #

    wp-dtree.php

  5. weirdrubikscube
    Member
    Posted 8 months ago #

    I absolutely do not see where in the php file I can set the img after the link in a dtNode div

    to me it seems it can only be changed in the js file around line 194

    but just moving the code between lines 197-203

    if(this.config.useIcons){
    		if(!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
    		if(!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
    		if(this.root.id != node.pid){
    			str += '<img id="i' + this._objName + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
    		}
    	}

    after line 224 (just before str += ' </div>';) doesn't seem to do anything... I'm lost here

    please advise

  6. ulfben
    Member
    Posted 8 months ago #

    Okay. Let's try this again.

    The PHP file controls which javascript file is being used on your site. Editing the wp-dtree.js doesn't make a difference, as the plugin only ever use the minified version; wp-dtree.min.js

    Since we can't work with a minified script you have to edit wp-dtree.php to use wp-dtree.js first. Then edit that script.

  7. weirdrubikscube
    Member
    Posted 8 months ago #

    I actually copied wp-dtree.js into wp-dtree.min.js so I could edit it more easily

    I still have no idea how I can put the icons on the right in wp-dtree.php

    can't you just give me a clue ???

  8. ulfben
    Member
    Posted 8 months ago #

    Clever. :)

    I'm sorry to say that I am of no use to you though. I haven't tried what you're attempting. Your first attempt seems reasonable enough, but you probably need to adjust the placement of indentation icons too (the empty gifs) and make sure to clear your cache (blog and browser) between reloads.

Reply

You must log in to post.

About this Plugin

About this Topic