Skip to content

Commit

Permalink
a little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Hartl committed Jan 25, 2009
1 parent 1ffc579 commit 802960f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ui/ui.tabs.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ $.widget("ui.tabs", {


// attach necessary classes for styling // attach necessary classes for styling
if (this.element.is('div')) { if (this.element.is('div')) {
// TODO replace hardcoded class names
this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all'); this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');
} }
this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
Expand Down Expand Up @@ -279,7 +278,6 @@ $.widget("ui.tabs", {
function switchTab(clicked, $li, $hide, $show) { function switchTab(clicked, $li, $hide, $show) {
var classes = ['ui-tabs-selected ui-state-active']; var classes = ['ui-tabs-selected ui-state-active'];
if (o.deselectable) classes.push('ui-tabs-deselectable'); if (o.deselectable) classes.push('ui-tabs-deselectable');
// TODO replace hardcoded class names
$li.removeClass('ui-state-default').addClass(classes.join(' ')) $li.removeClass('ui-state-default').addClass(classes.join(' '))
.siblings().removeClass(classes.join(' ')).addClass('ui-state-default'); .siblings().removeClass(classes.join(' ')).addClass('ui-state-default');
hideTab(clicked, $hide, $show); hideTab(clicked, $hide, $show);
Expand All @@ -288,7 +286,6 @@ $.widget("ui.tabs", {
// attach tab event handler, unbind to avoid duplicates from former tabifying... // attach tab event handler, unbind to avoid duplicates from former tabifying...
this.$tabs.unbind('.tabs').bind(o.event + '.tabs', function() { this.$tabs.unbind('.tabs').bind(o.event + '.tabs', function() {


//var trueClick = event.clientX; // add to history only if true click occured, not a triggered click
var $li = $(this).parents('li:eq(0)'), var $li = $(this).parents('li:eq(0)'),
$hide = self.$panels.filter(':visible'), $hide = self.$panels.filter(':visible'),
$show = $(self._sanitizeSelector(this.hash)); $show = $(self._sanitizeSelector(this.hash));
Expand All @@ -297,7 +294,6 @@ $.widget("ui.tabs", {
// or is already loading or click callback returns false stop here. // or is already loading or click callback returns false stop here.
// Check if click handler returns false last so that it is not executed // Check if click handler returns false last so that it is not executed
// for a disabled or loading tab! // for a disabled or loading tab!
// TODO replace hardcoded class names
if (($li.hasClass('ui-state-active') && !o.deselectable) if (($li.hasClass('ui-state-active') && !o.deselectable)
|| $li.hasClass('ui-state-disabled') || $li.hasClass('ui-state-disabled')
|| $(this).hasClass('ui-tabs-loading') || $(this).hasClass('ui-tabs-loading')
Expand All @@ -310,7 +306,6 @@ $.widget("ui.tabs", {
o.selected = self.$tabs.index(this); o.selected = self.$tabs.index(this);


// if tab may be closed // if tab may be closed
// TODO replace hardcoded class names
if (o.deselectable) { if (o.deselectable) {
if ($li.hasClass('ui-state-active')) { if ($li.hasClass('ui-state-active')) {
self.options.selected = null; self.options.selected = null;
Expand Down Expand Up @@ -463,7 +458,6 @@ $.widget("ui.tabs", {
}, },


select: function(index) { select: function(index) {
// TODO make null as argument work
if (typeof index == 'string') if (typeof index == 'string')
index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] ); index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] );
this.$tabs.eq(index).trigger(this.options.event + '.tabs'); this.$tabs.eq(index).trigger(this.options.event + '.tabs');
Expand Down

0 comments on commit 802960f

Please sign in to comment.