@@ -818,6 +818,18 @@ return $.widget( "ui.tabs", {
818
818
eventData = {
819
819
tab : tab ,
820
820
panel : panel
821
+ } ,
822
+ complete = function ( jqXHR , status ) {
823
+ if ( status === "abort" ) {
824
+ that . panels . stop ( false , true ) ;
825
+ }
826
+
827
+ tab . removeClass ( "ui-tabs-loading" ) ;
828
+ panel . removeAttr ( "aria-busy" ) ;
829
+
830
+ if ( jqXHR === that . xhr ) {
831
+ delete that . xhr ;
832
+ }
821
833
} ;
822
834
823
835
// not remote
@@ -835,28 +847,21 @@ return $.widget( "ui.tabs", {
835
847
panel . attr ( "aria-busy" , "true" ) ;
836
848
837
849
this . xhr
838
- . success ( function ( response ) {
850
+ . done ( function ( response , status , jqXHR ) {
839
851
// support: jQuery <1.8
840
852
// http://bugs.jquery.com/ticket/11778
841
853
setTimeout ( function ( ) {
842
854
panel . html ( response ) ;
843
855
that . _trigger ( "load" , event , eventData ) ;
856
+
857
+ complete ( jqXHR , status ) ;
844
858
} , 1 ) ;
845
859
} )
846
- . complete ( function ( jqXHR , status ) {
860
+ . fail ( function ( jqXHR , status ) {
847
861
// support: jQuery <1.8
848
862
// http://bugs.jquery.com/ticket/11778
849
863
setTimeout ( function ( ) {
850
- if ( status === "abort" ) {
851
- that . panels . stop ( false , true ) ;
852
- }
853
-
854
- tab . removeClass ( "ui-tabs-loading" ) ;
855
- panel . removeAttr ( "aria-busy" ) ;
856
-
857
- if ( jqXHR === that . xhr ) {
858
- delete that . xhr ;
859
- }
864
+ complete ( jqXHR , status ) ;
860
865
} , 1 ) ;
861
866
} ) ;
862
867
}
0 commit comments