<details> shim issues
-
Continuing the discussion from <details>:
Code used:
<details><summary>This will always display.</summary>This will display automatically on (re)bake or same-tab navigate, but be hidden on new-tab navigate and page refresh.</details>
This will always display.
This will display automatically on (re)bake or same-tab navigate, but be hidden on new-tab navigate and page refresh.May be a Firefox-only thing?
Also, I think I might have broken something else, thanks to the tag in the other thread title not being escaped… had to manually escape the title.
-
The shim is only required for Firefox (WebKit-derived browsers support <details> natively), and is only applied on page load:
The best way to fix this would probably to remove the shim’s
load
event listener and instead calldetails_shim
every time Discourse adds a post to the DOM.
-
shove it inside the code that adds or view raw button seems to be the best place for that.
yes i know it doesn't actually add the button, but it is custom JS that makes the button work!
-
Are we using the shim provided in the
discourse-details
plugin, or custom JS code?Also I encourage someone to come up with styling for it
-
there's a plugin?
-
Yeah. It adds a
[details=
bbcode tag too.
-
hu-uh.....
@PJH want to give that a go?
-
Are we using the shim provided in the discourse-details plugin, or custom JS code?
Custom JS - see @accalia's link.
@PJH want to give that a go?
Can't hurt to QA it...
@Sam - would you add it when you get a moment please?
-
Can't hurt to QA it...
Installed over on mine if anyone wants to play with it in the meantime:
http://pjh.homeip.net/t/details-test/71
... and there's one 'bug' already - quoted hidden details are revealed (even within the same forum.)
-
That's a sub-unbug of "quotes remove formatting"
-
-
hmm... well you asked for it coined, surely you can add it? :-P
-
sub-unbug
What does that even mean?! (Other than that it was obviously a good retsina that I had with dinner earlier.)
-
Will have to wait till next beta but will get it done