Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
toolbar.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Nov 2012 at 20:12 UTC
Updated:
2 Dec 2014 at 23:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #0.0
Bojhan commentedUpdated issue summary.
Comment #1
wim leersBojhan, if you still think we should do this, then we can do this tomorrow at DC Ghent 2014.
One problem with this proposal is that we must NOT do this on narrow viewports, because there the vertical tray would be used. Which means we'd lose a lot of screen real estate. So it'd have to be a "smart default".
Comment #2
Bojhan commentedYup, lets do this!
Comment #3
wim leersCool — clarifying title then :)
Comment #4
wim leersWhoever takes this on: #2103247: Clicking menu links in the administration menu tray should close the admin menu tray, while in a narrow viewport where the toolbar is positioned on top of the content is somewhat related, please read that for inspiration on how to do this.
Comment #5
tom verhaeghe commentedComment #6
tom verhaeghe commentedI'm not really sure this is a good attempt to fix the problem. With this patch the first menu tab wil be 'opened' by default if no tab was explicitly clicked before and only when the orientation of the tray is horizontal. I also stumbled upon some issues here:
Comment #7
tom verhaeghe commentedFixing inconsistency in comment.
Comment #8
wim leersThat's indeed the biggest problem in the patch.
We basically want to always get the first tab that is not the "Home" tab, which is a special snowflake, and if it exists, it's always going to be first. So we need a clean way of detecting it: we want a class to be set on that toolbar tab, just like there already is a class being set on the "shortcut" and "tour" toolbar tabs. Once we have that, we can use this selector and use the first matching element, and the ID for that element is the tab we want to activate:
To add that class, do this:
Comment #9
tom verhaeghe commentedThanks for the pointers, Wim. In this patch I added a class to the 'back to site' tab in the toolbar and now the first element is selected correctly.
Comment #10
tom verhaeghe commentedComment #11
wim leersshould mention that we exclude the 'home' toolbar tab.
== 'horizontal'Please use strict equality.
Comment #12
tom verhaeghe commentedComment #13
tom verhaeghe commentedComment #14
wim leersOnly one nitpick remains, then this is RTBC — thanks for your work! :) I manually tested this, and it works perfectly :)
80 cols rule.
Comment #15
tom verhaeghe commentedI tried to find it but I guess I'm looking over something. The longest line in the comments I made is 75 columns wide. However, there are some comments in
toolbar.js(that I didn't write) that violate this rule. Fixed in patch.What line is it exactly in?
Comment #16
wim leersWe don't only say that the *maximum* length is 80 cols, we also say that *if* a word on a following line fits on the previous line without exceeding 80 columns, that it should be on the previous line. *That* is what you violated.
Generally, we don't fix unrelated coding standards violations like you did in #15, because it makes reviews too difficult. This patch is small enough to do that though, so it's fine.
If you can just fix #14 also with the extra info I just gave you, this will be RTBC :)
Comment #17
tom verhaeghe commentedFixed #14 (80 columns rule)
Comment #18
wim leersAwesome, thank you!
Comment #19
Bojhan commentedGreat work, thanks @Tom and @Wim!
I am reclassifying this too, because it has a negative impact on the first-time experience (we observed this in the usability test for removing the overlay). As people look were they should go to engage with the system, this is a hurdle less.
Comment #20
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 232c10d and pushed to 8.0.x. Thanks!