@phenomlab thank you very much for the assistance Mark, massively appreciated as always.
The great thing about this is itโs all documented for other NodeBB users that come looking for solutions ๐.
Looks far better ๐ค๐๐ป.
@DownPW Correct. The design in DEV and the code on Git reflects the points you raised, which is why it was developed from scratch in DEV and was not a copy of PROD. Itโs a matter of personal taste You can fairly easily change the cosmetic behavior to suit your needs - itโs not set in stone.
@DownPW Maybe go one better perhaps, and toggle the on/off state depending on the switch selection (Iโm doing that here)
https://github.com/phenomlab/nodebb-harmony-threading/blob/main/functions%2Cjs
Enabled
Disabled
itโs cool too ^^
this code does not work for me. No button
EDIT:
The code on github is OK, not the last share above
@DownPW said in Threading support for NodeBB:
The code on github is OK, not the last share above
Sorry - changed that to the Git link
Just donโt forget to comment out lines for browsing-users plugin
Iโm got screwed
Good work my friend
@DownPW This part?
$('.topic .sticky-tools ul .hidden-xs').append(threadView);
// If you have browsing users plugin, comment out the above line and uncomment the one below
//$('.topic .sticky-tools ul [component="topic/browsing-users"]:last-of-type').append(threadView);
Yes, I need to fix that! Thanks for the reminder.
For anyone else browsing here who has tried the code in git
but wants it to look exactly like Sudonix, please note that this code is not public because it is heavily adapted to match the layout of this site. There are some Sudonix โclonesโ around so you can actually have this code if you really want it, but it comes with some conditions;
Hello @phenomlab
I see this, when someone composes, it is displayed via the plugin like this (To the left of the Thread View button.). I do not know if itโs normal or if it is better to put it on the right like the others ?
or myself for example :
@DownPW Mmmm - I thought that this would happen. In your js
function, can you locate this line
$('.topic .sticky-tools ul .hidden-xs').append(threadView);
Replace it with
$('.topic .sticky-tools ul.list-unstyled').append(threadView);
The issue here is that the hidden-xs
class is being manipulated by js
which forces the position and does not use relative
. This new code should hopefully work around that. It will change the placement of the threaded toggle, but for the better I think. If this works, Iโll commit the code to git
I donโt use this line, I commented out this line as stipulated in the script
$('.topic .sticky-tools ul .hidden-xs').append(threadView);
But use this line :
$('.topic .sticky-tools ul [component="topic/browsing-users"]:last-of-type').append(threadView);
maybe change for this ?
$('.topic .sticky-tools ul.list-unstyled [component="topic/browsing-users"]:last-of-type').append(threadView);
@DownPW sorry, use this one.
$('.topic .sticky-tools ul.list-unstyled').append(threadView);
Replace any existing line
With this code the entire plugin is now displayed to the left of the Thread View button. I even think I prefer the way it was before.
I find it more logical that all users are displayed to the right of the button and not to the left.
@DownPW up to you of course but the browsing users plugin makes several adjustments to element positioning, and without moving the threading toggle outside of that, youโll always have the issue where the composing user appears on the left because under the old code, the threading toggle shares the same space which causes the alignment issue.
Moving outside of that div is the only way to resolve the issue. There is another way which is to append the topic tools element but that then means that users without adequate permissions will not be able to use the threading toggle at all.
@DownPW yes, thatโs definitely a z-index
issue.
After test, seems to be good with add this in JS function in if
and else
:
$('[component="topic/quickreply/container"]').addClass('threaded'); //test
$('[component="topic/quickreply/container"]').removeClass('threaded'); //test
and this to CSS :
[component="topic/quickreply/container"].threaded {
z-index: -1 !important;
position: relative;
}
Tell me if this seems correct to you @phenomlab
@DownPW seems fine, yes. Any obvious conflict with other elements?
I havenโt tested everything. this is something to watch out for