inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jan 28, 2017 17:37:22 GMT -8
In reference to this thread: support.proboards.com/thread/610669/create-thread-posting-page-modificationI've tried coming up with some code for use in the global header, but it doesn't seem to be working properly: <script> $(document).ready(function() { if (pb.data('route').name = "new_thread") { $('.container > .title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>'); } }); </script>
It does show up on the Create thread page (like it's supposed to), but it's also showing up on the Thread List page. Isn't this: if (pb.data('route').name = "new_thread") { supposed to limit it to just the new thread page? EDIT: Nevermind. I just added another class found on that page to it, so this line: $('.container > .title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>');
to this: $('.container.new-area > .title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>');
This, of course, still doesn't explain why my if statement didn't limit it to the new thread page - so any insight on that would be appreciated! Also, upon further inspection, it also seems to disable the Collapsible Categories plugin - even though it is enabled in my manage plugins page. (EDIT: Fixed this by having it in Global Footer instead - but then it doesn't show at all.)
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jan 28, 2017 17:59:30 GMT -8
Just a small mistake on your part, that's all... pb.data('route').name = "new_thread"Can you see what you missed?
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jan 28, 2017 18:50:52 GMT -8
Thanks, Peter! Should be == and not = - as that's trying to assign "new_thread" what's on the left, which, of course, won't work. DORT! Thanks! (By the way, I hope you don't mind, but I've followed you on GitHub). Any idea why it stops the Collapsible Categories from working? (Seems to be working now)
|
|