Skip to content

Commit

Permalink
Merge class changes together, a bit of perf improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlietuna committed Jan 13, 2011
1 parent 0ba8cf6 commit f61de3a
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions js/bibliotype.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,17 @@
// Size toggles
//
$('.size1').click(function() {
$('#content_container').removeClass();
$('#content_container').addClass('bed');
$('#content_container').attr("class", "bed");
menuSet();
});

$('.size2').click(function() {
$('#content_container').removeClass();
$('#content_container').addClass('knee');
$('#content_container').attr("class", "knee");
menuSet();
});

$('.size3').click(function() {
$('#content_container').removeClass();
$('#content_container').addClass('breakfast');
$('#content_container').attr("class", "breakfast");
menuSet();
});

Expand All @@ -211,16 +208,12 @@
// Contrast Toggles
//
$('.highc').click(function() {
$('body').removeClass('low');
$('body').removeClass('high');
$('body').addClass('high');
$('body').removeClass('low high').addClass('high');
menuSet();
});

$('.lowc').click(function() {
$('body').removeClass('low');
$('body').removeClass('high');
$('body').addClass('low');
$('body').removeClass('low high').addClass('low');
menuSet();
});

Expand All @@ -229,16 +222,12 @@
// Justification Toggles
//
$('.just').click(function() {
$('body').removeClass('ragged');
$('body').removeClass('justified');
$('body').addClass('justified');
$('body').removeClass('ragged justified').addClass('justified');
menuSet();
});

$('.rag').click(function() {
$('body').removeClass('ragged');
$('body').removeClass('justified');
$('body').addClass('ragged');
$('body').removeClass('ragged justified').addClass('ragged');
menuSet();
});

Expand All @@ -247,25 +236,20 @@
// Serif toggle
//
$('.hel').click(function() {
$('body').removeClass('helvetica');
$('body').removeClass('georgia');
$('body').addClass('helvetica');
$('body').removeClass('georgia helvetica').addClass('helvetica');
menuSet();
});

$('.geo').click(function() {
$('body').removeClass('helvetica');
$('body').removeClass('georgia');
$('body').addClass('georgia');
$('body').removeClass('helvetica georgia').addClass('georgia');
menuSet();
});

// -------------------------------------
// Grid toggle
//
$('.bg_on').click(function() {
$('body').removeClass('bg_grid');
$('body').addClass('bg_grid');
$('body').removeClass('bg_grid').addClass('bg_grid');
menuSet();
});

Expand Down

0 comments on commit f61de3a

Please sign in to comment.