Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#1845 closed bug (fixed)

Tabs - Openning multiple AJAX tabs causes spinner to not be removed

Reported by: hiro Owned by: klaus
Priority: minor Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: tabs Cc:
Blocked by: Blocking:

Description

Using Tabs 3 which can be seen demoed on the test page: http://stilbuero.de/jquery/tabs_3/

Under "Ajax tabs"

Click tab Two then click tab Three very quickly before tab two finishes loading. Notice how the Loading... spinner dialog doesn't not get updated with the proper text? The spinner logo is removed on all tabs, but tab Two remains with the spinner text.

This appears to be caused around line 449 of ui.tabs.js by $span not being a direct pointer to each tab, but of the last one?

I believe I have a somewhat crude fix for this:

from line 442:

load if (o.spinner) {

$span.attr('text', $span.html());

$span.html('<em>' + o.spinner + '</em>');

}

setTimeout(function() { $(a.hash).load(url, function() {

if (o.spinner) {

tab_contents_id = "a[href='#"+a.href.split('#')[1]+"'] span"; $(tab_contents_id).html($(tab_contents_id).attr('text'));

} $a.removeClass(o.loadingClass);

...

This seems to solve the problem with my test case...

Attachments (1)

ui.tabs.js (19.5 KB) - added by hiro 12 years ago.
Modified version with ajax fix.

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by hiro

Attachment: ui.tabs.js added

Modified version with ajax fix.

comment:1 Changed 12 years ago by paul

Owner: set to klaus

comment:2 Changed 12 years ago by klaus

Resolution: fixed
Status: newclosed

comment:3 Changed 12 years ago by (none)

Milestone: 1.2.2

Milestone 1.2.2 deleted

comment:4 Changed 11 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.