Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
javascript
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jul 2012 at 14:21 UTC
Updated:
29 Jul 2014 at 20:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
nod_Comment #2
frega commentedRefactored along the lines in #1569648: Follow-up: Use localStorage to store tableDrag.showWeight value.
Notes:
- displayToolbar is a bit of a misnomer for what that function does (redrawing/updating state)
- one could argue about having the toolbar not being a "static" class, but an instantiated singleton (but that's almost bikeshedding)
Comment #3
nod_That's a good start :)
There is a link in the toolbar module to have a php callback setting a cookie to provide a no-js toggle of this. So we have to work around that.
As far as review goes, I'd be happy with selecting the elements only once in the attach behavior and send that to the methods afterwards.
Comment #4
frega commentedThere's a whole bunch of functions that access the cookie - we either refactor the functionality significantly or revert to using a cookie? Accessing localStorage obviously is not possible from PHP. Please advise :)
function _toolbar_is_collapsed() { // checks cookie, called from many places ...
function toolbar_preprocess_html(&$vars) { // attaches a class toolbar to the body?
function toolbar_toggle_page() { // toggles cookie
etc.
Comment #5
nod_Also, you can see the patch over there #1541860-31: Reduce dependency on jQuery for reference, we still need to sort out the toggle cookie support.
Comment #6
nod_Let's remove all those things and the cookie. If there is no JS available the shortcut bar stays open.
You can update the patch and let's wait for feedback :)
Comment #7
nod_tag
Comment #8
nod_included in #1137920: Fix toolbar on small screen sizes and redesign toolbar for desktop