Closed (won't fix)
Project:
Field Group
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2012 at 11:06 UTC
Updated:
1 Jun 2024 at 14:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nils.destoop commentedFunny, there was sprint yesterday, and we where discussing the same feature.
Comment #2
hydra commentedYeah, just working on that, will be coming soon I hope
Comment #3
hydra commentedWell, this was committed to 7.x-1.x, please don't use 2.x version, it is not supported!
The url changing actually just works for horizontal and vertical tabs! Maybe in a future version it will be working with any formatter.
Comment #4
okeedoak commentedLooking at the code the html needs a class of "group-wrapper", probably on the vertical tabs group, but the closest I have using vertical tabs is "field-group-tabs-wrapper". If I manually add the class "group-wrapper" to the vertical tabs group the hashes are set correctly. Although the URL shows the new hash tags after changing tabs there is no other effect, at least using Chrome, Opera or Firefox. Reloading the page with the hash tag as part of the URL has no effect on which tab is active and the browser's back button doesn't change the active tab only the URL.
Comment #5
okeedoak commentedThis code:
var fieldgorupID = 'field_group-' + $(this).attr('id') + ' ' + $(this).attr('id');causes the ID to be applied twice with a space in between each instance. Is this the desired behavior?
Comment #6
okeedoak commentedUnfortunately this violates the html5 spec stating that IDs can't contain spaces: http://www.w3.org/TR/html5/global-attributes.html#the-id-attribute
Comment #7
Stalski commentedThis is incorrect indeed. We'll check it asap
Comment #8
hydra commentedI know, this is totaly bad coding. But this is the only way to achive this, without having the page jumping to the anchor! Since it is in DOM I think it's not that bad, but still eval. If anyone has a better solution, would be great!
Comment #9
dropfen commentedHi, can anyone tell me what's about the 7.x-2.x version? Will it be supported, what's the best way to do it by myself? Since we can use IDs to jump to the tabs directly (very nice feature), it's the missing puzzle piece ;)
Comment #10
Ony commentedYes, seconding dropfen, would like to get more clarification on how to accomplish this
Comment #11
zooney commentedI've found that in field_group/horizontal-tabs/horizontal-tabs.js, if you add the following after the call to "self.focus();" on line 80:
...you can do this. I mean, it's a quick hack, I'm not sure if there's a better way to manage this, or if someone should just submit this as a patch.
Comment #12
gappleThe attached patch changes the page url without affecting the scroll position. It also handles hash change events on forward/back navigation to update the selected tab.
IDs on the page should be unique, and the behaviour of this patch is undetermined if that is not actually the case.
This is probably something that should be configurable though, as I can see some people not wanting tab changes to be reflected in the navigation history.
Comment #13
gappleThe last patch had an issue with the initial load of the page and handling going back to the un-hashed url, so here's a bit of a better structured approach
Comment #14
fabianx commented**RTBM** - Works great here!
Comment #17
toamit commentedThe older patch was out of sync with current file. Revised patch for horizontal-tabs.js
Comment #18
dercheffeI have the same problem like gapple in comment #12.
If I have two horizontal tabs, tab number 1 contains a separate link (e.g. inside a text field) linked to tab number 2. Now the user clicks on the link. The anchor is changing, but nothing else happens. The scroll position is still the same.
IMHO it's a good idea to fix this issue for improving the user experience.
Perhaps the revised patch of comment #17 should reviewed by the community, so I change the issue status.
Comment #21
scoff commentedThe patch at #12 is still valid for D8.1.1. I don't know if it would apply as I've done it manually.
It doesn't matter much for node edit forms but it's very useful for frontend ui.
Comment #22
grossmann commentedI could not apply the patch #17 successfully on 7.x-1.x so I created a new patch. Nothing of the code has been changed and it seem to work so far.
Maybe someone can review and test the patch to get this committed or can be worked on.
Comment #24
Pete B commentedThis patch will pass testing after #2871785: Tests failing in Drupal 7.50+ is committed.
Comment #26
kris77 commentedPatch #17 works fine for me too.
I use Field Group 7.x-1.5 and Drupal 7.54
Thanks @toamit
Comment #27
kris77 commented...It does not work when I submit the form.
If i click on submit button and there is an error, the page is loaded with the first tab...
Comment #28
douggreen commentedStripped ^M off of patch so that it applies.
Comment #29
pvasener commentedPatch is working for me.
Comment #30
nils.destoop commented