From e16e56f2aedaf1ef8214f9da1e8f264fbe44b6a7 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 31 Aug 2013 10:50:54 -0400 Subject: [PATCH] fixes #503 - Auto-select appropriate context on genre page --- dashboard-ui/scripts/itembynamedetailpage.js | 30 ++++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js index 673a1ab419..fabd83b9e8 100644 --- a/dashboard-ui/scripts/itembynamedetailpage.js +++ b/dashboard-ui/scripts/itembynamedetailpage.js @@ -179,49 +179,49 @@ if (result.MovieCount) { - html += ''; + html += ''; html += ''; } if (result.SeriesCount) { - html += ''; + html += ''; html += ''; } if (result.EpisodeCount) { - html += ''; + html += ''; html += ''; } if (result.TrailerCount) { - html += ''; + html += ''; html += ''; } if (result.GameCount) { - html += ''; + html += ''; html += ''; } if (result.AlbumCount) { - html += ''; + html += ''; html += ''; } if (result.SongCount) { - html += ''; + html += ''; html += ''; } if (result.MusicVideoCount) { - html += ''; + html += ''; html += ''; } @@ -231,7 +231,19 @@ bindRadioEvents(page); - $('input:first', elem).attr("checked", "checked").checkboxradio("refresh").trigger('click'); + var context = getParameterByName('context'); + var selectedRadio = null; + + if (context) { + selectedRadio = $('.context-' + context + ':first', elem); + } + + if (selectedRadio && selectedRadio.length) { + selectedRadio.attr("checked", "checked").checkboxradio("refresh").trigger('click'); + } else { + $('input:first', elem).attr("checked", "checked").checkboxradio("refresh").trigger('click'); + } + }); }