When using the default jquery_ui (v.1.6), or the included jquery ui tab (v.1.6), the active tab css property is "active",
but when using jquery_ui and jquery_update 2.x-dev with jquery 1.3.2 and jquery ui 1.7.x then the active tab css property is "ui-state-active".
With this patch and the right css styling for this new ui-state-active class, it is possible to have running the tabs module with jQuery 1.7.
This patch just replace the active class with the right one in tabs.module and tabs.js depending of jquery ui version.
I have tested it with cck fieldgroup tabs and works fine viewing tabs, editing tabs and editing tabs with errors, with jquery ui 1.6 or 1.7
(By the way, D7 will include that version and it seems that jquery update with jquery 1.3.2 is in the way to be solved once some of the ugliest issues with views was solved,
this will allow start using same jquery version in D6 and D7)
Comment | File | Size | Author |
---|---|---|---|
#35 | tabs.JPG | 15.25 KB | Vacilando |
#19 | tabs_jqueryui17.patch | 4.96 KB | jcmarco |
#9 | tabs_ui17_js.patch | 2.2 KB | jcmarco |
#7 | tabs_js_nav_ui17.patch | 2.27 KB | jcmarco |
#6 | tabs-fix.patch | 796 bytes | iamer |
Comments
Comment #1
nedjoThanks for the issue details and the patch.
I'd like to find a solution that works in all circumstances rather than testing for version.
Currently we use the 'active' class because that gives compatibility with Drupal core's tabs. We designate this as the selectedClass when calling .tabs():
Maybe support for selectedClass has been deprecated? If that's the case, I guess we might need to register enable and disable callbacks when calling .tabs() to add and then remove the 'active' class.
What css is minimally needed for the ui-state-active class? I guess we need to add that too to the patch.
jmarco, are you up for doing up a revised patch?
Comment #2
jcmarco CreditAttribution: jcmarco commentedI have been playing with a new version, following your recommendations.
On this version:
- active tabs assignation is only done with the ui.tabs functions,
- it is forcing a change to the same active tab css class in order to have only a css file
- this css file comes from the basic theming for ui.tabs 1.7, with some adjustments that probably will need more tuning.
- for #activated tab property, I use a neutral class that is changed in the tabs.js using ui.tabs functions to assign the right class.
- I have removed selectedClass because it was deprecated (http://dev.jqueryui.com/ticket/3691)
I have tested it with jQuery UI 1.7, 1.6 (one coming in the module), viewing tabs, editing forms and forms with errors ( I haven't yet tested it assigning #activated to a form )
Comment #3
nedjoThanks!
I've applied an adapted version of this patch. I don't want to add css yet; I'd like to wait for theme support to be added to jQuery UI module in #266692: Settings for the theme used by jQuery UI. When that's in, we can use the registered theme for the css.
Setting to postponed until that issue is committed.
Comment #4
mrfelton CreditAttribution: mrfelton commentedSo what has been applied and what hasn't? What do I need to do to get things working with 1.7.
ps. #266692: Settings for the theme used by jQuery UI has been replaced with #388384: Allow usage of jQuery UI themes from the themeroller, and I have the patch for that applied and I have a jquery_ui theme installed and working correctly.
Comment #5
mrfelton CreditAttribution: mrfelton commentedSo what has been applied and what hasn't? What do I need to do to get things working with 1.7.
ps. #266692: Settings for the theme used by jQuery UI has been replaced with #388384: Allow usage of jQuery UI themes from the themeroller, and I have the patch for that applied and I have a jquery_ui theme installed and working correctly.
Comment #6
iamer CreditAttribution: iamer commentedAfter enabling jquery update and jquery.ui update, panels tab style was not working. The attached very simple patch makes it work.
Comment #7
jcmarco CreditAttribution: jcmarco commentedI updated this patch to add support to jQuery UI 1.7 with last tabs release.
- I used the most simple patch from @iamer
- adding ui-tabs-selected/active is not needed because is already added by the jQuery UI 1.7
- there is an error using tab titles for the navigation buttons titles
Comment #8
nedjoThis patch will break the current functionality of setting the 'active' class to support default drupal tab styling. Could you work up one that maintained the current functionality?
Comment #9
jcmarco CreditAttribution: jcmarco commentedI have left the active class to add compatibility with the default drupal class.
And now, when disabling jquery update and jquery ui (with 1.3.x and 1.7.x) the tabs works the same.
For theming, in default drupal jquery you need to use the active class
and when using jquery ui 1.7.x theming then you use ui-tabs-selected
Comment #10
nedjoThanks for the revised patch.
A bug that appeared previously and that was fixed involved ul lists placed on tabs. Because the selector used processed all ul elements in the tabs div, lists on tabs were transformed into broken tabs.
The current patch looks like it could revive that bug, since it removes the '> ul' selector.
Could you explain why it's necessary to change the handling of the selectors and not just switch out the classes used?
Before applying this, I want to make sure it doesn't break when lists are placed on tabs. You can test this by e.g. placing a textarea on a tab and manually coding an HTML list into the textarea.
Comment #11
iamer CreditAttribution: iamer commentedActually I didn't remove the "> ul" selector, I just moved it after the .tabs() invocation.
I looked at jquery.ui tabs documentation and it said to invoke the .tabs() function on the parent container that contains the tabs.
Before the patch the .tabs() function was being called on each "ul"
Comment #12
iamer CreditAttribution: iamer commentedSorry for the hasty reply, I think I get what you mean , I will try the test case you mentioned and see what happens.
Comment #13
jcmarco CreditAttribution: jcmarco commentedThere is an "issue", the jQuery UI Tabs in 1.6.x have a different behavior than 1.7.x.
In 1.6 the tab is applied to the ul and in 1.7 is applied in the wrapper div, so probably there will be always problems
trying to get the same js logic for the two versions.
For the D7 version is easy because it already comes with the jQuery UI 1.7.2 so the tabs.js needs this change.
But for D6 there is the possibility to have both. We could detect the jQuery UI version with jquery_ui_get_version() in the tabs_load()
changing the loaded tabs.js to some like tabs.ui17.js at this time. (or add this info to the js settings and change the js execution).
I wouldn't complicate the js logic and I will add a second tabs.js compatible with jquery.ui.1.7, that in any case it would be needed for D7.
Comment #14
mrfelton CreditAttribution: mrfelton commentedThe last version of this patch (the one at #9) gets the tabs working again for me. Thanks.
Comment #15
john.money CreditAttribution: john.money commented+1 jcmarco patch #9
Comment #16
mrgoltra CreditAttribution: mrgoltra commentedsubscribing
Comment #17
miro_dietikerWorks for our setup after need to upgrade to jQuery UI 1.7 ...
Confirm this to work with panels_tabs.module
Don't forget to rebuild performance cache to avoid browser caching issues in admin/settings/performance
Comment #18
nedjoI agree with the approach of detecting jquery UI version and having a separate file for jQuery UI 1.7 and would welcome a patch.
Comment #19
jcmarco CreditAttribution: jcmarco commentedThis patch add a jquery ui version control and adds an extra js with just the jquery ui 1.7.x settings.
Comment #20
joostvdl CreditAttribution: joostvdl commentedPatch #19 is working for me!
jquery 1.3.2
jquery_ui 1.7.2
Comment #21
Zach Harkey CreditAttribution: Zach Harkey commentedPatch #19 is working for me too.
jquery 1.3.2
jquery_ui 1.7.2
Comment #22
gooddesignusa CreditAttribution: gooddesignusa commentedPatch #19 worked for me using Tabs 6.x-1.3
using
jquery 1.3.2
jquery_ui 1.7.2
Thanks a lot
Comment #23
clashar CreditAttribution: clashar commentedPlease help,
I can't understand which patch I should apply.
There are many here.
I tried all of them, but only "tabs-fix.patch" from post #6 and "tabs_jqueryui17.patch" from post #19.
I try to apply them to Tabs module
I use:
Tabs "tabs-6.x-1.3"
jQuery UI "jquery-ui-1.7.3"
jquery "jquery_ui-6.x-1.3"
I have already spent two whole days but still can't solve the problem.
Comment #24
clashar CreditAttribution: clashar commentedduplicate
Comment #25
stoltoguzzi CreditAttribution: stoltoguzzi commentedsame here, which patch to use?
Comment #26
jcmarco CreditAttribution: jcmarco commented#19 works with both versions of jQuery UI
Comment #27
nedjoThanks iamer and jmarco for the patch and apologies it's taken me a long time to review.
The latest patch had a minor error; version checking should have been something like:
But I tested with the patch at #9 and found no issues with nested lists, so I've applied that instead.
Comment #28
nedjoSpoke too soon, patch in #9 did indeed break things--all links in lists processed as tabs. I've applied an adapted version of the patch in #19. I couldn't get jquery_ui 1.7 working so couldn't test, but it's broken as it is so I figured we may as well apply the attempted fix and work from there.
Anyone who knows how to test this: please provide exact steps from a clean Drupal install for setting up jquery_update and jquery_ui 1.7 to test. Testing of the HEAD version of tabs (which now includes this patch) would also be great. Thanks!
Comment #29
Vector- CreditAttribution: Vector- commentedSince I don't see any responses to this... figured you might be interested in knowing...
The latest dev snapshot is, fundamentally at least, working with jQuery 1.4.2 and jQuery UI 1.8.2 - I have definitely not done any sort of comprehensive testing yet...
From what I can tell, API for tabs hasn't changed much from 1.7 to 1.8, so chances are pretty good it works in 1.7 too.
PS: I'm actually seeing a CSS bug that's causing multiple lines of tabs to act awkwardly, but I'm not sure the fault for that is the Tabs module...
Unless someone has this problem on anything vaguely approaching a stable setup... well, I'm going to assume it's probably a local problem ;)
Comment #30
Ogredude CreditAttribution: Ogredude commentedPatch #19 plus the change in comment #27 works for me. Thanks!
Comment #31
protoplasm CreditAttribution: protoplasm commentedPatch #19 saved the day for me. Thanks.
Comment #32
Zach Harkey CreditAttribution: Zach Harkey commentedComment #33
NathanM CreditAttribution: NathanM commentedIs this implemented in the dev release yet?
Comment #34
Vector- CreditAttribution: Vector- commentedThis was committed to dev on May 24, 2010.
Setting Version accordingly, if I'm messing this up, or if problems still exist related to this in 6.x-1.x-dev, please change it back... works for me though.
http://drupal.org/cvs?commit=371086
Comment #35
Vacilando CreditAttribution: Vacilando commentedWorks OK indeed, even with jQuery UI 1.8.4.
Comment #36
mcpuddin CreditAttribution: mcpuddin commented@Vector - This functionality is in 6.x-1.x-dev and not in 6.x-1.3. I believe once a new release is set, anything fixed in 6.x-1.x-dev will be set to "fixed in the most recent version".
If i'm wrong for setting this back to 6.x-1.x-dev, someone please scold me sharply
Comment #37
davidwhthomas CreditAttribution: davidwhthomas commentedtabs 6.x-1.x-dev fixed the issue here too, thanks.
jquery: 1.3.2
jquery_ui: 1.7.x
DT
Comment #38
drupalninja99 CreditAttribution: drupalninja99 commentedworks great, thx!
Comment #39
lpalgarvio CreditAttribution: lpalgarvio commentedsubscribing
Comment #40
nedjoThis appears to be fixed.
Need to roll a new release.
Comment #41
podarokWorking for me with 6.x-dev
http://drupal.org/node/239151
jquery_update
http://drupal.org/node/779956
+
jquery_ui http://drupal.org/node/906160
with
http://code.google.com/p/jquery-ui/downloads/detail?name=jquery-ui-1.7.3...
+ cck_fieldgroup_tabs
http://drupal.org/node/696798
mostly stable - can be 6.x-1.3
tested on Opera 11, 10.63
Firefox
IE8
Chrome
Comment #42
miro_dietikerpodarok
So if this works, this is not RTBC but much more fixed state. Reverting back.
Comment #43
podarokwith this patch there is a problem with views UI tabs
but possible it is a views bug (views used very old jquery tabs.js)
Comment #44
miro_dietikerThen it (the patch) doesn't need review (because it was committed) but it much more needs work or the topic is active.
If however it is not fixed, you need to describe exactly how to reproduce the issue your talking about.
In any other case an open issue doesn't make any sense.
Comment #45
rjl CreditAttribution: rjl commentedNot sure if you are still needing comments, but I am using tabs with some custom code and it is working for me.
- tabs 6.x-1.x-dev
- jquery: 1.3.2
- jquery_ui: 1.7.x
Thanks to all
Comment #47
zazinteractive CreditAttribution: zazinteractive commentedThanks for #19