From 07809340c843f9cb6c0f8ad2d8d8746970ff09c9 Mon Sep 17 00:00:00 2001 From: Klaus Hartl Date: Wed, 18 Feb 2009 21:44:34 +0000 Subject: Tabs: solved spinner issues and ajax loading not being stopped when selecting a static page tab, fixes #4109, #3929 --- tests/unit/tabs/spinner.gif | Bin 0 -> 2530 bytes tests/unit/tabs/tabs.html | 12 ++++++------ tests/unit/tabs/tabs_core.js | 29 +++++++++++++++++++++++++++++ tests/unit/tabs/tabs_defaults.js | 2 +- tests/unit/tabs/test.html | 1 + 5 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 tests/unit/tabs/spinner.gif create mode 100644 tests/unit/tabs/test.html (limited to 'tests/unit') diff --git a/tests/unit/tabs/spinner.gif b/tests/unit/tabs/spinner.gif new file mode 100644 index 000000000..85b99d46b Binary files /dev/null and b/tests/unit/tabs/spinner.gif differ diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index d9cb4d138..69cd8f481 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -24,9 +24,9 @@
@@ -34,9 +34,9 @@
diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js index ba5f3d014..79e95ea41 100644 --- a/tests/unit/tabs/tabs_core.js +++ b/tests/unit/tabs/tabs_core.js @@ -7,4 +7,33 @@ var el; module("tabs: core"); +test('ajax', function() { + expect(4); + stop(); + + el = $('#tabs2'); + + el.tabs({ + selected: 2, + load: function() { + // spinner: default spinner + equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed"); + equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed"); + el.tabs('destroy'); + el.tabs({ + selected: 2, + spinner: '', + load: function() { + // spinner: image + equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed"); + equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed"); + start(); + } + }); + } + }); + +}); + + })(jQuery); diff --git a/tests/unit/tabs/tabs_defaults.js b/tests/unit/tabs/tabs_defaults.js index 306e8c86e..f5a583e2c 100644 --- a/tests/unit/tabs/tabs_defaults.js +++ b/tests/unit/tabs/tabs_defaults.js @@ -12,7 +12,7 @@ var tabs_defaults = { fx: null, idPrefix: 'ui-tabs-', panelTemplate: '
', - spinner: 'Loading…', + spinner: 'Loading…', tabTemplate: '
  • #{label}
  • ' }; diff --git a/tests/unit/tabs/test.html b/tests/unit/tabs/test.html new file mode 100644 index 000000000..cd59e6415 --- /dev/null +++ b/tests/unit/tabs/test.html @@ -0,0 +1 @@ +

    …content loaded via Ajax.

    \ No newline at end of file -- cgit v1.2.3