I break down certain sections of my site into levels of complexity. I call the folders Easy, Powerful and Complete. However, since you can't name pages the exact same name, I actually have to write it as Easy (Administration), Powerful (Administration) and Complete (Administration).
I do this ONLY because I can't name pages the same thing.
I want to use jQuery (or other technique) to hide from the visitor the parts in parens. I can get it to work onLoad, but not if the page is lazy-loaded in via Ajax.
Can anyone suggest a technique to do this?
Thanks!
Community moderators have prevented the ability to post new answers.
The only way I can think of would be to hijack the page tree load method. The pattern would look like this.
AJS.toInit(function(){ var pageTreeLoadMethodOld = AJS.pageTreeLoadMethod; AJS.pageTreeLoadMethod = function(){ pageTreeLoadMethodOld(); //Now you can do your stuff here } });
Is this every time the tree expands or just on the initial load?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, it looks like it doesn't load the whole tree initially, so it would be for every expand ... unless they are all at the root level.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, this didn't work at all. I didn't get a JS error, but it didn't work at all. I just put an alert in the // part. Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ran across this the other day while looking at the JS code and I think this is probably the better way to do it. I couldn't find any documentation on it, so I kinda just had to look through JS code for it. Maybe there is some documentation somewhere I just wan't finding it readily.
AJS.toInit(function(){ AJS.bind('pagetree-children-loaded', function(){ //Your stuff here. }); });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.