Skip to main content

Search and Top Navigation

Ticket #3659: ui.tab-add-placeholder-spinners.patch
File ui.tab-add-placeholder-spinners.patch, 1.5 KB (added by J5, December 11, 2008 08:46PM UTC)
--- ui/ui.tabs.js.old	2008-12-11 18:57:37.000000000 +0000
+++ ui/ui.tabs.js	2008-12-11 20:30:04.000000000 +0000
@@ -438,16 +438,38 @@
 		var cleanup = function() {
 			self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass)
 					.each(function() {
-						if (o.spinner)
-							inner(this).parent().html(inner(this).data('label.tabs'));
+						if (o.spinner) {
+							if (o.spinner_placeholder) {
+								var $placeholder = o.spinner_placeholder;
+								if (!$placeholder.jquery)
+									$placeholder = $(o.spinner_placeholder, this);
+								
+								var $inner_span = $('> span', $placeholder);
+								$placeholder.html($inner_span.data('placeholder.tabs'));
+							} else {
+								inner(this).parent().html(inner(this).data('label.tabs'));
+							}
+						}
 					});
 			self.xhr = null;
 		};
 
 		if (o.spinner) {
-			var label = inner(a).html();
-			inner(a).wrapInner('')
-				.find('em').data('label.tabs', label).html(o.spinner);
+			if (o.spinner_placeholder) {
+				var $placeholder = o.spinner_placeholder;
+				if (!$placeholder.jquery)
+					$placeholder = $(o.spinner_placeholder, a);
+
+				var ph_inner = $placeholder.html();
+				$placeholder.html('')
+					.find('span')
+						.data('placeholder.tabs', ph_inner)
+							.html(o.spinner);
+			} else {
+				var label = inner(a).html();
+				inner(a).wrapInner('')
+					.find('em').data('label.tabs', label).html(o.spinner);
+                        }
 		}
 
 		var ajaxOptions = $.extend({}, o.ajaxOptions, {

Download in other formats:

Original Format