Problem/Motivation
There are some cases where I don't want quicktabs to remember the last clicked tab on page reload.
Proposed resolution
Add a configuration checkbox on the tab settings page to remember the last clicked tab per quicktabs instance.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | quicktabs--3189439-MR37.patch | 7.28 KB | loze |
| #19 | after_patch.png | 96.1 KB | indrapatil |
| #18 | 3189439-after-patch.png | 265.32 KB | sahil.goyal |
| #18 | 3189439-before-patch.png | 307.25 KB | sahil.goyal |
| #14 | interdiff-7-13.txt | 1004 bytes | floydm |
Issue fork quicktabs-3189439
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
loze commentedHere is a patch that provides a setting on the quicktabs instance config page for "Remember list clicked tab" which determines if the cookie is used in the js.
thanks.
Comment #3
loze commentedJust correcting spelling mistakes in the last patch.
Comment #4
loze commentedI forgot that I had submitted a similar patch a while back. #3177587: Better default tab behavior
So I've closed that issue in favor of this one which I think is a better.
Comment #5
lubwn commentedPatch from #3 works like a charm! Thank you a lot.
I suggest we push this to production, applied cleanly and works nicely.
Comment #6
loze commentedComment #7
loze commentedThis is broken now that we are using the core/js-cookie library instead of jquery cookie. Will provide a new patch shortly
Comment #8
loze commentedComment #9
loze commentedThis patch gets the cookies working with js-cookie. Thanks.
Comment #10
loze commentedComment #11
niklp commentedWould I be correct in saying that this is the part of the patch that fixes the "$.cookie is not a function" error?
Comment #12
loze commentedits part of it but not all of it.
see: https://www.drupal.org/node/3104677
Comment #13
floydm commentedThe config change and javascript from comment 9 work great but AFAICT the QuickTabsInstanceEditForm does not save or reflect the remember_last_clicked_tab value from the config.
The attached patch makes explicit the saving of that value.
Comment #14
floydm commentedComment #17
keshavv commentedThe patch given in #9 and #14 failed to apply due to some recent code changes.
The patch #9 also combines the Cookie issue, Which is already fixed on latest
8.x-3.xBranch.So I have created the MR that will only add the configuration to toggle the remember last clicked tab.
Please review the MR
Thank you.
Comment #18
sahil.goyal commentedThanks @keshavv as described #9 and #14 are now getting failed and some changes already been committed.
MR!14 is working correctly and tab history should be configurable and cookie can now and confirming its working fine and no any issue has been observed, attaching screenshots for the references.
RTBC+1
Comment #19
indrapatil commentedHi
I have tested the patch it working I attached the screenshot for reference.
Comment #20
keshavv commentedComment #21
kburakozdemir commentedpatch#14 works for me. thanks. RTBC+1...
Comment #22
smustgrave commentedWill need an upgrade hook + test coverage
Comment #24
loze commentedMR 37 is against 4.0.x
Still needs update hook and test coverage.
Comment #27
loze commentedIgnore MR14, that is no longer valid and I am unable to close it.
MR37 is the latest, against 4.0.x
Here is a patch for composer that should work with the 4.0.x dev branch
Comment #28
loze commentedComment #29
smustgrave commentedThere’s no upgrade hook or test coverage
Comment #30
loze commentedIve added an update hook which sets the new default value on all existing QT instances.
Added the config variable to QuicktabsConfigSchemaTest but I am unsure how to go about testing the actual functionality and could use some help, thanks.
Comment #31
smustgrave commentedSo the update hook will need to be in a post update hook and use a ConfigImporter of some kind to do in batches.
Comment #32
loze commentedIve added quicktabs.post_update.php. Is this more along the line of what you are asking for?