Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Update JS to use new tab markup; ignore window.location.hash
Browse files Browse the repository at this point in the history
  • Loading branch information
tofumatt committed Jun 3, 2011
1 parent ee152f7 commit b28eedf
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions media/js/input-mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,41 @@
return;
}

$(this).toggleClass('collapsed')
$(this).toggleClass('collapsed');
return false;
});
};
$.fn.filters = function() {
this.find('input[type=checkbox]').click(doSubmit);
this.find('select').change(doSubmit);
return this;

function doSubmit(e) {
$(e.currentTarget).closest('form').submit();
return false;
}

this.find('input[type=checkbox]').click(doSubmit);
this.find('select').change(doSubmit);
return this;
};


$(document).ready(function() {
$('.collapsible').collapsible();
$('#filters').filters();

$('#header ul a').click(function(e) {
var clicked = $(this);
clicked.parent().siblings('li').find('a').each(function() {
var tohide = $(this);
tohide.removeClass('selected');
$(tohide.attr('href')).hide();
});
clicked.addClass('selected');
$(clicked.attr('href')).show();
}).first().click();

var hash = window.location.hash,
subpage = $('#header a[href$='+hash+']').first();
if (!subpage)
subpage = $('#header ul a:first');
subpage.click();

$('#tabs a').live('click', function(e) {
$('.section').hide();
$($(this).attr('href')).show();

$('#tabs a').removeClass('selected');
$(this).addClass('selected').blur();

return false;
});

// Activate the first tab
$('#tabs a:first').click();

// Scroll past the browser's location bar in iOS/Firefox for Android
window.scrollTo(0, 1);
});

})(jQuery);

0 comments on commit b28eedf

Please sign in to comment.