sindre_mehus wrote:retteketet wrote:Hi Sindre,
great news that we can select genre & decade in de "home.view" in the new realease.
But are we stuck by min/max of 40 albums on the page?
the option listSize doesnt seem to work anymore.
I use the listSize option in my subsonic. I take the window size and calculate the amount of albums that can be shown in the window using some javascript.
Can you please put the listSize option back in the final release?
Hi,
Would you mind sharing the details about the javascript you use to accomplish this? I might consider adding it to Subsonic.
Thanks,
Sindre
Hi Sindre,
i'm not a programmer. but this is what i did: (a lot of copy paste from google)
1 read the window size initial and after resizing the window
2 calculate the amount of albums that would fit. (minimum of 4)
3 if the amount of albums is different then before a reload will be triggered with the new amount of albums
3 calculate extra padding for vertical alignment on the page
i show the albums using the text-alignment "jusify" for horizontal alignment on the page.
function get_albums()
{
var a = 4;
var margin_width = 4;
var framewidth = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
framewidth = framewidth + margin_width
var albumwidth = Math.floor(framewidth / 114);
var margin_bottom = 0;
var frameheight = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
frameheight = frameheight - margin_bottom;
var albumheight = Math.floor(frameheight / 147);
var extrapadding = frameheight%147;
extrapadding = Math.floor(extrapadding / albumheight);
var totals = albumheight*albumwidth;
if (totals < 4)
{
a = 4;
}
else
{
a = albumheight*albumwidth;
}
var b = QueryString.listSize;
var c = window.location.href
c=c.replace(new RegExp("&listSize=[0-9]*","ig"),"")
if (a != b)
{
window.location.href = c + "&listSize=" + a;
}
divs=document.getElementsByTagName('div');
for (var i=0;i<divs.length;i++){
if (divs[i].id.indexOf("blockdiv")==0){//only if 'image' is at the beginning of the id
divs[i].style.padding = "0px 0px " + extrapadding + "px 0px";
}
}