Problem adding classes and removing before and after ajaxify
-
I'm having problems trying to remove this class on a route after a username. The class is suppose to only be called on this route and no route after.
domain.tld/user/username
instead, it stays the same ondomain.tld/user/username/edit
Here's the script I have so far;
$(window).on('action:ajaxify.end', function(ev, data) { if ( data.url === '' || data.url.indexOf('user') !== -1) $(".forum-logo").addClass("forum-logo-alt"), }); $(window).on('action:ajaxify.start', function(ev, data) { if ( data.url !== '' && data.url.indexOf('user') === -1) $(".forum-logo").removeClass("forum-logo-alt"), });
Any ideas?
-
-
Where I was trying to get at was whenever anyone visited a profile, the logo would change (addClass) and will change back to normal (removeClass) when they browse off that page. I will try your method to see if that works.
Edit: That actually fixed the problem. Thanks a bunch!
Copyright © 2024 NodeBB | Contributors