diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index d7f0e03ce1..6b6a23a86a 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -1006,6 +1006,10 @@ progress { font-weight: normal !important; text-decoration: none; vertical-align: middle; + border: 0; + outline: 0; + cursor: pointer; + cursor: hand; } .accentButton-g { diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index a851e90a81..c6523db5f9 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -137,8 +137,8 @@ ${ButtonPlayTrailer} ${ButtonPlay} - ${ButtonSync} + @@ -154,8 +154,8 @@ ${ButtonPlayTrailer} ${ButtonPlay} - ${ButtonSync} +

diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 4b5ac41a90..3c1e4e6b12 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -717,10 +717,42 @@ } } - var _childrenItemsQuery = null; + function getEpisodesFunction(seriesId, query) { + + query = $.extend({}, query); + + return function (index, limit, fields) { + + query.StartIndex = index; + query.Limit = limit; + query.Fields = fields; + + return ApiClient.getEpisodes(seriesId, query); + + }; + + } + + function getAlbumSongsFunction(query) { + + query = $.extend({}, query); + + return function (index, limit, fields) { + + query.StartIndex = index; + query.Limit = limit; + query.Fields = fields; + + return ApiClient.getItems(Dashboard.getCurrentUserId(), query); + + }; + + } + + var _childrenItemsFunction = null; function renderChildren(page, item, user, context) { - _childrenItemsQuery = null; + _childrenItemsFunction = null; var fields = "ItemCounts,AudioInfo,PrimaryImageAspectRatio,SyncInfo"; @@ -753,9 +785,18 @@ userId: user.Id, Fields: fields }); + + _childrenItemsFunction = getEpisodesFunction(item.SeriesId, { + + seasonId: item.Id, + userId: user.Id + }); + } + else if (item.Type == "MusicAlbum") { + + _childrenItemsFunction = getAlbumSongsFunction(query); } - _childrenItemsQuery = query; promise = promise || ApiClient.getItems(Dashboard.getCurrentUserId(), query); promise.done(function (result) { @@ -794,6 +835,7 @@ showTitle: true, displayAsSpecial: item.Type == "Season" && item.IndexNumber, context: context, + playFromHere: true, overlayText: true }); } @@ -1566,11 +1608,11 @@ $('.childrenItemsContainer', page).on('playallfromhere', function (e, index) { - LibraryBrowser.playAllFromHere(_childrenItemsQuery, index); + LibraryBrowser.playAllFromHere(_childrenItemsFunction, index); }).on('queueallfromhere', function (e, index) { - LibraryBrowser.queueAllFromHere(_childrenItemsQuery, index); + LibraryBrowser.queueAllFromHere(_childrenItemsFunction, index); }); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 0899324a51..4e1f636c61 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -90,14 +90,9 @@ return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds()); }, - playAllFromHere: function (query, index) { + playAllFromHere: function (fn, index) { - query = $.extend({}, query); - query.StartIndex = index; - query.Limit = 100; - query.Fields = "MediaSources,Chapters"; - - ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { + fn(index, 100, "MediaSources,Chapters").done(function (result) { MediaController.play({ items: result.Items @@ -106,12 +101,8 @@ }, queueAllFromHere: function (query, index) { - query = $.extend({}, query); - query.StartIndex = index; - query.Limit = 100; - query.Fields = "MediaSources,Chapters"; - ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { + fn(index, 100, "MediaSources,Chapters").done(function (result) { MediaController.queue({ items: result.Items @@ -695,7 +686,7 @@ } } - var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options); + var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options, index); var cssClass = options.smallIcon ? 'ui-li-has-icon listItem' : 'ui-li-has-thumb listItem'; @@ -705,7 +696,7 @@ var href = LibraryBrowser.getHref(item, options.context); - html += '
  • '; + html += '
  • '; var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '" class="itemWithAction"') : ''; html += ''; @@ -846,7 +837,7 @@ return outerHtml; }, - getItemDataAttributes: function (item, options) { + getItemDataAttributes: function (item, options, index) { var atts = []; @@ -861,6 +852,7 @@ atts.push('data-playaccess="' + (item.PlayAccess || '') + '"'); atts.push('data-locationtype="' + (item.LocationType || '') + '"'); + atts.push('data-index="' + index + '"'); if (item.IsPlaceHolder) { atts.push('data-placeholder="true"'); @@ -1214,7 +1206,7 @@ cssClass += ' bottomPaddedCard'; } - var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options); + var dataAttributes = LibraryBrowser.getItemDataAttributes(item, options, i); var defaultActionAttribute = options.defaultAction ? (' data-action="' + options.defaultAction + '"') : '';