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

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 844
    • 189
  • Source
  • Commits
  • Network (189)
  • Graphs
  • Tree: 18171c2

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 (20)
    • 1.9m2
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.3
    • 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: fixed a few issues in rotate method extension
Klaus Hartl (author)
Sun Mar 01 07:27:40 -0800 2009
commit  18171c2f89b87ac61383
tree    41d50c1a85df5d27dcf1
parent  240a588bce03e72ca485
M ui/ui.tabs.js 27 ••••
Txt ui/ui.tabs.js
  • View file @ 18171c2
... ...
@@ -640,31 +640,34 @@ $.extend($.ui.tabs.prototype, {
640 640
   rotation: null,
641 641
   rotate: function(ms, continuing) {
642 642
 
643  
-    var self = this, o = this.options, t = o.selected;
644  
-
645  
-    var rotate = function() {
  643
+    var self = this, o = this.options;
  644
+    
  645
+    var rotate = self._rotate || (self._rotate = function(e) {
646 646
       clearTimeout(self.rotation);
647 647
       self.rotation = setTimeout(function() {
648  
-        t = ++t < self.anchors.length ? t : 0;
649  
-        self.select(t);
  648
+        var t = o.selected;
  649
+        self.select( ++t < self.anchors.length ? t : 0 );
650 650
       }, ms);
651  
-    };
  651
+      
  652
+      if (e) {
  653
+        e.stopPropagation();
  654
+      }
  655
+    });
652 656
     
653  
-    var stop = !continuing ?
  657
+    var stop = self._unrotate || (self._unrotate = !continuing ?
654 658
       function(e) {
655 659
         if (e.clientX) { // in case of a true click
656  
-          clearTimeout(self.rotation);
657  
-          self.element.unbind('tabsshow', rotate);
  660
+          self.rotate(null);
658 661
         }
659 662
       } :
660 663
       function(e) {
661 664
         t = o.selected;
662 665
         rotate();
663  
-      };
  666
+      });
664 667
 
665 668
     // start rotation
666 669
     if (ms) {
667  
-      this.element.bind('tabsshow', rotate); // will not be attached twice
  670
+      this.element.bind('tabsshow', rotate);
668 671
       this.anchors.bind(o.event + '.tabs', stop);
669 672
       rotate();
670 673
     }
... ...
@@ -673,6 +676,8 @@ $.extend($.ui.tabs.prototype, {
673 676
       clearTimeout(self.rotation);
674 677
       this.element.unbind('tabsshow', rotate);
675 678
       this.anchors.unbind(o.event + '.tabs', stop);
  679
+      delete this._rotate;
  680
+      delete this._unrotate;
676 681
     }
677 682
   }
678 683
 });

0 notes on commit 18171c2

Please log in to comment.
Blog | Support | Training | Job Board | 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
  • 中文