diff --git a/_includes/layout-change.js b/_includes/layout-change.js index 6a17718..ffb765c 100644 --- a/_includes/layout-change.js +++ b/_includes/layout-change.js @@ -1,24 +1,25 @@ -// change layout -var isHorizontal = false; -$('#layouts a').click(function(){ - var mode = $(this).attr('href').slice(1); - wasHorizontal = isHorizontal; - isHorizontal = $(this).hasClass('horizontal'); + + // change layout + var isHorizontal = false; + $('#layouts a').click(function(){ + var mode = $(this).attr('href').slice(1); + wasHorizontal = isHorizontal; + isHorizontal = $(this).hasClass('horizontal'); - if ( wasHorizontal !== isHorizontal ) { - // need to do some clean up for transitions and sizes - var style = isHorizontal ? - { height: '80%', width: $demo.width() } : - { width: 'auto' }; - $demo.addClass('no-transition').css( style ); - setTimeout(function(){ - $demo.removeClass('no-transition').isotope({ layoutMode : mode }); - }, 100 ) - } else { - // go ahead and apply new layout - $demo.isotope({ layoutMode : mode }); + if ( wasHorizontal !== isHorizontal ) { + // need to do some clean up for transitions and sizes + var style = isHorizontal ? + { height: '80%', width: $demo.width() } : + { width: 'auto' }; + $demo.addClass('no-transition').css( style ); + setTimeout(function(){ + $demo.removeClass('no-transition').isotope({ layoutMode : mode }); + }, 100 ) + } else { + // go ahead and apply new layout + $demo.isotope({ layoutMode : mode }); - } + } - return false; -}); \ No newline at end of file + return false; + }); \ No newline at end of file diff --git a/_includes/option-buttons.js b/_includes/option-buttons.js index ea411d9..d710e07 100644 --- a/_includes/option-buttons.js +++ b/_includes/option-buttons.js @@ -1,12 +1,14 @@ -$('#options').find('.option-set a').click(function(){ - var $this = $(this); - - // don't proceed if already selected - if ( $this.hasClass('selected') ) { - return; - } - - $this.parents('.option-set').find('.selected').removeClass('selected'); - $this.addClass('selected'); - -}); + + // switches selected class on buttons + $('#options').find('.option-set a').click(function(){ + var $this = $(this); + + // don't proceed if already selected + if ( $this.hasClass('selected') ) { + return; + } + + $this.parents('.option-set').find('.selected').removeClass('selected'); + $this.addClass('selected'); + + }); diff --git a/_includes/sort-buttons.html b/_includes/sort-buttons.html new file mode 100644 index 0000000..a7f06e2 --- /dev/null +++ b/_includes/sort-buttons.html @@ -0,0 +1,24 @@ +