Hello,
I am using the navbar module and the drupal8 toolbar. I think the way its using localStorage.remoteItem instead of changing the state's of the localStorageItem can lead to some confusion.
For example :
The variable
'Drupal.toolbar.trayVerticalLocked'
starts by being null, it then gets a value of 'true' if the user has interacted with it and if the user toggles the toolbar to the top it goes back to null instead of going to false.
if for some reason there is the need to check / diff from initial state (null) to the current state (also null) you just cant.
A possible example (my current) :
I want to set the initial state of the variable to true so that the toolbar opens on the left side by default and not on top. I cant check for localStorage.getItem because I cant tell if the variable is null because its the initial state or if the its null because it was closed specifically by the user.
I think both states should be differentiated.
I can release some patch but just wanted to know some opinions, maybe I am looking at it the wrong way entirely.
Best regards
Comments
Comment #2
joaogarin commentedComment #3
joaogarin commentedComment #11
nod_So, hum, a little bit late but I don't think you're looking about it wrong.
If I remember it was done this way to have a more predictable behavior for the toolbar, or at least prevent a mistake where the toolbar would be stuck in the horizontal state on narrow screens.
We can always talk about this, and now we have tests so it'll be easier to change.
Comment #19
quietone commentedThe Toolbar Module was approved for removal in #3476882: [Policy] Move Toolbar module to contrib.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3484850: [meta] Tasks to deprecate Toolbar module and the removal work in #3488828: [meta] Tasks to remove Toolbar module.
Toolbar will be moved to a contributed project before Drupal 12.0.0 is released.
Comment #20
quietone commentedThe Toolbar module have moved from core to contrib.