[nodebb-script-dismissible] Dismissable Widgets
-
Thanks, will come in handy for a nice maintenance message or something like that, lol.
-
You mean you want it to come back? For development purposes you could do open up your console and clear your localStorage cache (or just clear your cache altogether)
localStorage.clear();
If you want it to show up again for all users, just change the localStorage ID to something new (from
(!localStorage.getItem('dismissible')
to(!localStorage.getItem('dismissible-1')
and same with thesetItem
a few lines below) -
@psychobunny When you hard refresh the page, the widget reappears. Think he wants that to stop happening.
-
Hmm.. just gave that a shot on both FF and chrome, clicked on the dismiss text and refreshed, it's not showing up anymore. Or did you just mean, "only show it once, if you refresh hide it even if the user didn't dimiss it"? In that case:
Hey! Welcome to our forums. If you don't want to see this message again, <strong id="dismiss">click here</strong> <script> if (!localStorage.getItem('dismissible')) { $('#dismissible').removeClass('hide'); } $('#dismiss').on('click', function() { $('#dismissible').hide(); }); localStorage.setItem('dismissible', true); </script>
-
This post is deleted!
-
Haha maybe @Scuzz has the same problem too
-
@psychobunny That just makes it hidden all together lol :S
-
Figured it out @Scuzz? Let me know if not I'll help you out