Skip to content

Instantly share code, notes, and snippets.

@Nikki0
Created August 2, 2017 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikki0/e2238c745339035c4bc24ac1c3aa036d to your computer and use it in GitHub Desktop.
Save Nikki0/e2238c745339035c4bc24ac1c3aa036d to your computer and use it in GitHub Desktop.
function bindGrid()
{
var view = $.totalStorage('display');
if (!view && (typeof displayList != 'undefined') && displayList)
view = 'list';
if (view && view != 'grid')
display(view);
else
$('.display').find('li#grid').addClass('selected');
$(document).on('click', '#grid', function(e){
e.preventDefault();
display('grid');
});
$(document).on('click', '#list', function(e){
e.preventDefault();
display('list');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment