Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The "selected" feature wasn't working so I tracked down through the code and found the issue.
This used to be working because it looked for the active class on the <a>
. However, in the latest commit to the fork JS it switched to look on the <li>
. In theory either one should be fine, but since "active" is usually added by the l() function for Drupal it probably makes more sense to keep it looking at the <a>
.
This is literally a two character patch.
The relevant diff to see the change is here: http://drupalcode.org/project/tinynav.git/blobdiff/5e8016dafd6720b36bc90...
Comment | File | Size | Author |
---|---|---|---|
#1 | 0001-Issue-2212963-Change-looking-from-li-to-a-for-select.patch | 1.16 KB | sokrplare |
Comments
Comment #1
sokrplare CreditAttribution: sokrplare commentedComment #2
btopro CreditAttribution: btopro commentedcan we get a second or third in terms of reviewing this patch? I see exactly what you mean, just want some confirmation from a wider audience. Makes sense to me
Comment #3
dflitner CreditAttribution: dflitner commentedPatch in #1 worked for me. I'm using 7.x-1.3, not the -dev version.
Background:
I have two menus I want to use tinynav for.
I changed my active class to "active" from "active-trail" because that's what the module-created menu uses (QuickTabs). This made the second menu which is a regular Drupal menu not get properly selected in tinynav mode because the li has an "active-trail" class and the a has only an "active" class. Applied this patch and now the current page is correctly selected in the tinynav menu.
Comment #4
btopro CreditAttribution: btopro at Pennsylvania State University commentedneeded to rebase but applied to dev. thanks for testing, accepted.
Comment #6
tiikeri CreditAttribution: tiikeri commentedI was writing just about the same problem, but the patch here fixed it. Thanks