mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Merge pull request #396 from Abbe98/book-download-btn
Move download action to major button for books (itemdetailspage)
This commit is contained in:
commit
e20f7e02ea
@ -133,7 +133,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
|
||||
}
|
||||
}
|
||||
|
||||
if (item.CanDownload && appHost.supports('filedownload')) {
|
||||
// Books are promoted to major download Button and therefor excluded in the context menu
|
||||
if ((item.CanDownload && appHost.supports('filedownload')) && item.Type !== "Book") {
|
||||
commands.push({
|
||||
name: globalize.translate('Download'),
|
||||
id: 'download'
|
||||
|
@ -323,6 +323,10 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
||||
} else itemBirthLocation.classList.add("hide");
|
||||
setPeopleHeader(page, item), loading.hide()
|
||||
|
||||
if (item.Type === "Book") {
|
||||
hideAll(page, "btnDownload", true);
|
||||
}
|
||||
|
||||
try {
|
||||
require(["focusManager"], function(focusManager) {
|
||||
[".btnResume", ".btnPlay"].every(function (cls) {
|
||||
@ -1174,6 +1178,17 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
||||
reload(self, view, params)
|
||||
}
|
||||
|
||||
function onDownloadClick() {
|
||||
require(['fileDownloader'], function (fileDownloader) {
|
||||
var downloadHref = apiClient.getItemDownloadUrl(currentItem.Id);
|
||||
fileDownloader.download([{
|
||||
url: downloadHref,
|
||||
itemId: currentItem.Id,
|
||||
serverId: currentItem.serverId
|
||||
}]);
|
||||
});
|
||||
}
|
||||
|
||||
function onMoreCommandsClick() {
|
||||
var button = this;
|
||||
apiClient.getCurrentUser().then(function(user) {
|
||||
@ -1223,6 +1238,7 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
||||
bindAll(view, ".btnCancelSeriesTimer", "click", onCancelSeriesTimerClick);
|
||||
bindAll(view, ".btnCancelTimer", "click", onCancelTimerClick);
|
||||
bindAll(view, ".btnDeleteItem", "click", onDeleteClick);
|
||||
bindAll(view, ".btnDownload", "click", onDownloadClick);
|
||||
view.querySelector(".btnMoreCommands i").innerHTML = "";
|
||||
view.querySelector(".trackSelections").addEventListener("submit", onTrackSelectionsSubmit);
|
||||
view.querySelector(".btnSplitVersions").addEventListener("click", function() {
|
||||
|
@ -71,6 +71,17 @@
|
||||
<span>${ButtonPlay}</span>
|
||||
</button>
|
||||
|
||||
<button is="emby-button" type="button" class="button-flat btnDownload hide detailButton-mobile">
|
||||
<div class="detailButton-mobile-content">
|
||||
<i class="md-icon detailButton-mobile-icon"></i>
|
||||
<div class="detailButton-mobile-text">${ButtonDownload}</div>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<button is="emby-button" type="button" class="raised btnDownload hide detailButton">
|
||||
<span>${ButtonDownload}</span>
|
||||
</button>
|
||||
|
||||
<button is="emby-button" type="button" class="button-flat btnPlayTrailer hide detailButton-mobile">
|
||||
<div class="detailButton-mobile-content">
|
||||
<i class="md-icon detailButton-mobile-icon"></i>
|
||||
|
Loading…
Reference in New Issue
Block a user