r1924 - trunk/ui

r1924 - trunk/ui


Author: klaus.hartl
Date: Fri Jan 30 17:16:59 2009
New Revision: 1924
Modified:
trunk/ui/ui.tabs.js
Log:
Tabs: reviewed and simplified just a bit
Modified: trunk/ui/ui.tabs.js
==============================================================================
--- trunk/ui/ui.tabs.js    (original)
+++ trunk/ui/ui.tabs.js    Fri Jan 30 17:16:59 2009
@@ -325,12 +325,10 @@
            // which can become a usability and annoying problem with
tabs('rotate').
            if ($.browser.msie) this.blur();
-            return false;
-
        });
-        // disable click if event is configured to something else
-        if (o.event != 'click') this.$tabs.bind('click.tabs', function(){return
false;});
+        // disable click in any case
+        this.$tabs.bind('click.tabs', function(){return false;});
    },
@@ -473,8 +471,7 @@
    load: function(index, callback) { // callback is for internal usage only
        var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0],
-                bypassCache = callback == undefined || callback === false, url =
$a.data('load.tabs');
-                // TODO bypassCache == false should work
+                bypassCache = callback == undefined, url = $a.data('load.tabs');
        callback = callback || function() {};
@@ -577,7 +574,7 @@
    rotation: null,
    rotate: function(ms, continuing) {
-        var self = this, t = this.options.selected;
+        var self = this, o = this.options, t = o.selected;
        function rotate() {
            clearTimeout(self.rotation);
@@ -590,7 +587,7 @@
        // start rotation
        if (ms) {
            this.element.bind('tabsshow', rotate); // will not be attached twice
-            this.$tabs.bind(this.options.event + '.tabs', !continuing ?
+            this.$tabs.bind(o.event + '.tabs', !continuing ?
                function(e) {
                    if (e.clientX) { // in case of a true click
                        clearTimeout(self.rotation);
@@ -598,7 +595,7 @@
                    }
                } :
                function(e) {
-                    t = self.options.selected;
+                    t = o.selected;
                    rotate();
                }
            );
@@ -608,7 +605,7 @@
        else {
            clearTimeout(self.rotation);
            this.element.unbind('tabsshow', rotate);
-            this.$tabs.unbind(this.options.event + '.tabs', stop);
+            this.$tabs.unbind(o.event + '.tabs', stop);
        }
    }
});