github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 832
    • 188
  • Source
  • Commits
  • Network (188)
  • Graphs
  • Tree: 240a588

click here to add a description

click here to add a homepage

  • Switch Branches (8)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
    • widget-super
  • Switch Tags (19)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.2
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Tabs: few fixes required in destroy method, removed ol as tabifyable element
Klaus Hartl (author)
Sun Mar 01 06:32:29 -0800 2009
commit  240a588bce03e72ca485
tree    4397d8a816a8d3dc2214
parent  676ea7f248c94d351325
M tests/unit/tabs/tabs_methods.js 8 ••••
M ui/ui.tabs.js 33 ••••
Txt tests/unit/tabs/tabs_methods.js
  • View file @ 240a588
... ...
@@ -22,16 +22,18 @@ test('init', function() {
22 22
 });
23 23
 
24 24
 test('destroy', function() {
25  
-  expect(5);
  25
+  expect(6);
26 26
   
27  
-  el = $('#tabs1').tabs();
  27
+  el = $('#tabs1').tabs({ collapsible: true });
  28
+  $('li:eq(2)', el).simulate('mouseover').find('a').focus();
28 29
   el.tabs('destroy');
29 30
   
30  
-  ok( el.is(':not(.ui-tabs, .ui-widget, .ui-widget-content, .ui-corner-all)'), 'remove classes from container');
  31
+  ok( el.is(':not(.ui-tabs, .ui-widget, .ui-widget-content, .ui-corner-all, .ui-tabs-collapsible)'), 'remove classes from container');
31 32
   ok( $('ul', el).is(':not(.ui-tabs-nav, .ui-helper-reset, .ui-helper-clearfix, .ui-widget-header, .ui-corner-all)'), 'remove classes from list' );
32 33
   ok( $('div:eq(1)', el).is(':not(.ui-tabs-panel, .ui-widget-content, .ui-corner-bottom, .ui-tabs-hide)'), 'remove classes to panel' );
33 34
   ok( $('li:eq(0)', el).is(':not(.ui-tabs-selected, .ui-state-active, .ui-corner-top)'), 'remove classes from active li');  
34 35
   ok( $('li:eq(1)', el).is(':not(.ui-state-default, .ui-corner-top)'), 'remove classes from inactive li');
  36
+  ok( $('li:eq(2)', el).is(':not(.ui-state-hover, .ui-state-focus)'), 'remove classes from mouseovered or focused li');
35 37
 });
36 38
 
37 39
 test('enable', function() {
Txt ui/ui.tabs.js
  • View file @ 240a588
... ...
@@ -65,13 +65,13 @@ $.widget("ui.tabs", {
65 65
         .find('span:data(label.tabs)')
66 66
         .each(function() {
67 67
           var el = $(this);
68  
-          el.html(el.data('label.tabs'));
  68
+          el.html(el.data('label.tabs')).removeData('label.tabs');
69 69
         });
70 70
   },
71 71
 
72 72
   _tabify: function(init) {
73 73
 
74  
-    this.list = this.element.children('ul:first, ol:first').eq(0);
  74
+    this.list = this.element.children('ul:first');
75 75
     this.lis = $('li:has(a[href])', this.list);
76 76
     this.anchors = this.lis.map(function() { return $('a', this)[0]; });
77 77
     this.panels = $([]);
... ...
@@ -391,8 +391,10 @@ $.widget("ui.tabs", {
391 391
   destroy: function() {
392 392
     var o = this.options;
393 393
 
  394
+    this.abort();
  395
+    
394 396
     this.element.unbind('.tabs')
395  
-      .removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all')
  397
+      .removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible')
396 398
       .removeData('tabs');
397 399
 
398 400
     this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
... ...
@@ -413,18 +415,19 @@ $.widget("ui.tabs", {
413 415
         $(this).remove();
414 416
       }
415 417
       else {
416  
-        $(this).removeClass(
417  
-          'ui-state-default ' +
418  
-          'ui-corner-top ' +
419  
-          'ui-tabs-selected ' +
420  
-          'ui-state-active ' +
421  
-          'ui-state-hover ' +
422  
-          'ui-tabs-collapsible ' +
423  
-          'ui-state-disabled ' +
424  
-          'ui-tabs-panel ' +
425  
-          'ui-widget-content ' +
426  
-          'ui-corner-bottom ' +
427  
-          'ui-tabs-hide');
  418
+        $(this).removeClass([
  419
+          'ui-state-default',
  420
+          'ui-corner-top',
  421
+          'ui-tabs-selected',
  422
+          'ui-state-active',
  423
+          'ui-state-hover',
  424
+          'ui-state-focus',
  425
+          'ui-state-disabled',
  426
+          'ui-tabs-panel',
  427
+          'ui-widget-content',
  428
+          'ui-corner-bottom',
  429
+          'ui-tabs-hide'
  430
+        ].join(' '));
428 431
       }
429 432
     });
430 433
 

0 notes on commit 240a588

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server
  • English
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文