LocalStorage used for Explorer view
This commit is contained in:
parent
5ed5aff945
commit
8d39956724
@ -32,6 +32,7 @@ jQuery(document).ready(function($)
|
|||||||
paramTag = (urlParams.get('tags') == null ? urlParams.getAll('tag') : urlParams.getAll('tags'));
|
paramTag = (urlParams.get('tags') == null ? urlParams.getAll('tag') : urlParams.getAll('tags'));
|
||||||
paramPhoto = (urlParams.get('photos') == null ? urlParams.getAll('photo') : urlParams.getAll('photos'));
|
paramPhoto = (urlParams.get('photos') == null ? urlParams.getAll('photo') : urlParams.getAll('photos'));
|
||||||
paramHelp = (urlParams.get('helps') == null ? urlParams.getAll('help') : urlParams.getAll('helps'));
|
paramHelp = (urlParams.get('helps') == null ? urlParams.getAll('help') : urlParams.getAll('helps'));
|
||||||
|
paramView = (urlParams.get('view'));
|
||||||
params = { "year": paramYear, "month": paramMonth, "dimension": paramDimension, "genre": paramGenre, "theme": paramTheme, "place": paramPlace, "tag": paramTag, "photo": paramPhoto, "help": paramHelp }
|
params = { "year": paramYear, "month": paramMonth, "dimension": paramDimension, "genre": paramGenre, "theme": paramTheme, "place": paramPlace, "tag": paramTag, "photo": paramPhoto, "help": paramHelp }
|
||||||
|
|
||||||
$.getJSON("data.json", function(data)
|
$.getJSON("data.json", function(data)
|
||||||
@ -522,6 +523,35 @@ jQuery(document).ready(function($)
|
|||||||
$("article.explorer p.result").css("display", "none");
|
$("article.explorer p.result").css("display", "none");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setGallery()
|
||||||
|
{
|
||||||
|
$("table").hide();
|
||||||
|
$("#gallery").show();
|
||||||
|
window.localStorage.setItem('explorer-view', 'gallery');
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTable()
|
||||||
|
{
|
||||||
|
$("#gallery").hide();
|
||||||
|
$("table").show();
|
||||||
|
window.localStorage.setItem('explorer-view', 'table');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paramView == "gallery")
|
||||||
|
setGallery();
|
||||||
|
else if (paramView == "table")
|
||||||
|
setTable();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (res)
|
||||||
|
{
|
||||||
|
explorerView = window.localStorage.getItem('explorer-view');
|
||||||
|
if (explorerView == "gallery")
|
||||||
|
setGallery();
|
||||||
|
else if (explorerView == "table")
|
||||||
|
setTable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// fancybox configuration
|
// fancybox configuration
|
||||||
$.getScript("scripts/fancybox.js", function() {
|
$.getScript("scripts/fancybox.js", function() {
|
||||||
|
@ -335,16 +335,17 @@ function userActionHandle(availableOptions)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// change display: gallery/table
|
// change display: gallery/table
|
||||||
$(".style-select.frame").click(function()
|
$(".style-select.frame").click(function()
|
||||||
{
|
{
|
||||||
$("table").hide();
|
$("table").hide();
|
||||||
$("#gallery").show();
|
$("#gallery").show();
|
||||||
|
window.localStorage.setItem('explorer-view', 'gallery');
|
||||||
});
|
});
|
||||||
$(".style-select.list").click(function()
|
$(".style-select.list").click(function()
|
||||||
{
|
{
|
||||||
$("#gallery").hide();
|
$("#gallery").hide();
|
||||||
$("table").show();
|
$("table").show();
|
||||||
|
window.localStorage.setItem('explorer-view', 'table');
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user