Fixed masonry layout with home/tags filter.

This commit is contained in:
kor 2018-07-16 04:21:20 +12:00
parent ec40b20aa4
commit 9bd3256c07
2 changed files with 7 additions and 3 deletions

View File

@ -35,7 +35,7 @@ body {
padding:20px;
min-height:2.4em;
float:left;
box-sizing: border-box;
}
.grid-item:hover {
background:#bbb;

View File

@ -26,10 +26,10 @@ function Main()
this.start = function()
{
this.load(window.document.location.hash == "" ? 'Home' : window.document.location.hash);
this.load(window.document.location.hash == "" ? 'home' : window.document.location.hash);
}
this.load = function(target = "Home")
this.load = function(target = "home")
{
target = target.substr(0,1) == "#" ? target.substr(1,target.length-1) : target
target = target.trim() == "" ? "home" : target
@ -48,7 +48,9 @@ function Main()
{
console.log('home');
this.grid.innerHTML = '';
this.displayEntries(this.database);
this.msnry.reloadItems();
this.msnry.layout();
console.log(this.database);
@ -79,6 +81,7 @@ function Main()
this.grid.innerHTML = '';
this.displayEntries(tempDatabase);
this.msnry.reloadItems();
this.msnry.layout();
}
else if (splitTarget[0] == 'type')
@ -259,6 +262,7 @@ function Main()
entry += `</div>`;
this.grid.innerHTML += entry;
// this.msnry.appended( entry );
}
// this.doPagination = function()