| 95 | | if (a.hash == location.hash) { |
| 96 | | o.selected = i; |
| 97 | | // prevent page scroll to fragment |
| 98 | | //if (($.browser.msie || $.browser.opera) && !o.remote) { |
| 99 | | if ($.browser.msie || $.browser.opera) { |
| 100 | | var $toShow = $(location.hash), toShowId = $toShow.attr('id'); |
| 101 | | $toShow.attr('id', ''); |
| 102 | | setTimeout(function() { |
| 103 | | $toShow.attr('id', toShowId); // restore id |
| 104 | | }, 500); |
| | 94 | this.$tabs.each(function(i, a) { |
| | 95 | if (a.hash == location.hash) { |
| | 96 | o.selected = i; |
| | 97 | // prevent page scroll to fragment |
| | 98 | if ($.browser.msie || $.browser.opera) { // && !o.remote |
| | 99 | var $toShow = $(location.hash), toShowId = $toShow.attr('id'); |
| | 100 | $toShow.attr('id', ''); |
| | 101 | setTimeout(function() { |
| | 102 | $toShow.attr('id', toShowId); // restore id |
| | 103 | }, 500); |
| | 104 | } |
| | 105 | scrollTo(0, 0); |
| | 106 | return false; // break |
| 119 | | }); |
| 120 | | |
| | 115 | else if (self.$lis.filter('.' + o.selectedClass).length) |
| | 116 | o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] ); |
| | 117 | } |
| | 118 | o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; // first tab selected by default |
| | 119 | |
| | 120 | // Take disabling tabs via class attribute from HTML |
| | 121 | // into account and update option properly. |
| | 122 | // A selected tab cannot become disabled. |
| | 123 | o.disabled = $.unique(o.disabled.concat( |
| | 124 | $.map(this.$lis.filter('.' + o.disabledClass), |
| | 125 | function(n, i) { return self.$lis.index(n); } ) |
| | 126 | )).sort(); |
| | 127 | if ($.inArray(o.selected, o.disabled) != -1) |
| | 128 | o.disabled.splice($.inArray(o.selected, o.disabled), 1); |
| | 129 | |
| 134 | | // load if remote tab |
| 135 | | if ($.data(this.$tabs[o.selected], 'load.tabs')) |
| 136 | | this.load(o.selected, onShow); |
| 137 | | // just trigger show event |
| 138 | | else |
| 139 | | onShow(); |
| 140 | | |
| 141 | | } |
| 142 | | |
| 143 | | // Take disabling tabs via class attribute from HTML |
| 144 | | // into account and update option properly... |
| 145 | | o.disabled = $.unique(o.disabled.concat( |
| 146 | | $.map(this.$lis.filter('.' + o.disabledClass), |
| 147 | | function(n, i) { return self.$lis.index(n); } ) |
| 148 | | )).sort(); |
| | 143 | // load if remote tab |
| | 144 | if ($.data(this.$tabs[o.selected], 'load.tabs')) |
| | 145 | this.load(o.selected, onShow); |
| | 146 | // just trigger show event |
| | 147 | else |
| | 148 | onShow(); |
| | 149 | |
| | 150 | } |