diff --git a/dashboard-ui/apiclient/apiclient.js b/dashboard-ui/apiclient/apiclient.js
index 47b80fa65e..99acc35728 100644
--- a/dashboard-ui/apiclient/apiclient.js
+++ b/dashboard-ui/apiclient/apiclient.js
@@ -205,7 +205,23 @@
headers['Content-Type'] = contentType;
}
- return fetch(request.url, fetchRequest);
+ if (!request.timeout) {
+ return fetch(request.url, fetchRequest);
+ }
+
+ return new Promise(function (resolve, reject) {
+
+ var timeout = setTimeout(reject, request.timeout);
+
+ fetch(request.url, fetchRequest).then(function (response) {
+ clearTimeout(timeout);
+ resolve(response);
+ }, function (error) {
+ clearTimeout(timeout);
+ throw error;
+ });
+
+ });
}
function paramsToString(params) {
@@ -256,9 +272,9 @@
return Promise.reject(response);
}
- }, function () {
+ }, function (error) {
onFetchFail(request.url, {});
- return Promise.reject({});
+ throw error;
});
}
@@ -379,7 +395,7 @@
return Promise.reject(response);
}
- }, function () {
+ }, function (error) {
logger.log("Request failed to " + request.url);
@@ -390,26 +406,26 @@
var previousServerAddress = self.serverAddress();
- tryReconnect().then(function () {
+ return tryReconnect().then(function () {
logger.log("Reconnect succeesed");
request.url = request.url.replace(previousServerAddress, self.serverAddress());
- self.fetchWithFailover(request, false);
+ return self.fetchWithFailover(request, false);
- }, function () {
+ }, function (innerError) {
logger.log("Reconnect failed");
onFetchFail(request.url, {});
- return Promise.reject({});
-
+ throw innerError;
});
+
} else {
logger.log("Reporting request failure");
onFetchFail(request.url, {});
- return Promise.reject({});
+ throw error;
}
});
};
@@ -590,7 +606,13 @@
var now = new Date().getTime();
- return self.get(url).then(function () {
+ return self.ajax({
+
+ type: "GET",
+ url: url,
+ timeout: 5000
+
+ }).then(function () {
var responseTimeSeconds = (new Date().getTime() - now) / 1000;
var bytesPerSecond = byteSize / responseTimeSeconds;
diff --git a/dashboard-ui/apiclient/connectionmanager.js b/dashboard-ui/apiclient/connectionmanager.js
index aad79382e8..e67da395ff 100644
--- a/dashboard-ui/apiclient/connectionmanager.js
+++ b/dashboard-ui/apiclient/connectionmanager.js
@@ -113,7 +113,23 @@
headers['Content-Type'] = contentType;
}
- return fetch(request.url, fetchRequest);
+ if (!request.timeout) {
+ return fetch(request.url, fetchRequest);
+ }
+
+ return new Promise(function (resolve, reject) {
+
+ var timeout = setTimeout(reject, request.timeout);
+
+ fetch(request.url, fetchRequest).then(function (response) {
+ clearTimeout(timeout);
+ resolve(response);
+ }, function (error) {
+ clearTimeout(timeout);
+ throw error;
+ });
+
+ });
}
function paramsToString(params) {
@@ -154,8 +170,8 @@
return Promise.reject(response);
}
- }, function () {
- return Promise.reject({});
+ }, function (error) {
+ throw error;
});
}
diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css
index a6b8ef6239..a3a8a229b6 100644
--- a/dashboard-ui/css/card.css
+++ b/dashboard-ui/css/card.css
@@ -340,7 +340,7 @@
}
.overflowBackdropCard {
- width: 80%;
+ width: 84%;
max-width: 400px;
}
diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css
index 2098f761d5..c4b97b61c6 100644
--- a/dashboard-ui/css/librarybrowser.css
+++ b/dashboard-ui/css/librarybrowser.css
@@ -463,12 +463,16 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
}
.itemDetailImage {
- -moz-box-shadow: 0px 0 20px #000;
- -webkit-box-shadow: 0px 0 20px #000;
- box-shadow: 0px 0 20px #000;
- border: solid 1px #222;
+ border: solid 1px transparent;
}
+ .itemDetailImage.loaded {
+ -moz-box-shadow: 0px 0 20px #000;
+ -webkit-box-shadow: 0px 0 20px #000;
+ box-shadow: 0px 0 20px #000;
+ border: solid 1px #222;
+ }
+
.detailImageContainer img {
width: 280px;
/* This is just to make sure it always takes up some space */
diff --git a/dashboard-ui/scripts/chromecast.js b/dashboard-ui/scripts/chromecast.js
index b612b2442b..b93bc47cdc 100644
--- a/dashboard-ui/scripts/chromecast.js
+++ b/dashboard-ui/scripts/chromecast.js
@@ -781,7 +781,10 @@
self.endSession = function () {
- castPlayer.stopApp();
+ self.stop();
+ setTimeout(function () {
+ castPlayer.stopApp();
+ }, 1000);
};
self.volumeUp = function () {
diff --git a/dashboard-ui/scripts/externalplayer.js b/dashboard-ui/scripts/externalplayer.js
index 9f8052d8c4..6cd032c701 100644
--- a/dashboard-ui/scripts/externalplayer.js
+++ b/dashboard-ui/scripts/externalplayer.js
@@ -167,7 +167,7 @@
function playInternalPostMediaSourceSelection(item, mediaSource, startPosition, deferred) {
- Dashboard.hideModalLoadingMsg();
+ Dashboard.hideLoadingMsg();
currentItem = item;
currentMediaSource = mediaSource;
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index 4c8d05f1e1..b53f2ce38e 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -644,7 +644,7 @@
}
function enableScrollX() {
- return browserInfo.mobile && AppInfo.enableAppLayouts;
+ return browserInfo.mobile && AppInfo.enableAppLayouts && screen.availWidth <= 1000;
}
function getPortraitShape() {
@@ -899,7 +899,7 @@
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: getPortraitShape(),
- showTitle: false,
+ showTitle: true,
centerText: true,
lazy: true
});
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 2d877acd4d..6faf41a725 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -3260,6 +3260,11 @@
}
var img = elem.querySelector('img');
+ img.onload = function () {
+ if (img.src.indexOf('empty.png') == -1) {
+ img.classList.add('loaded');
+ }
+ };
ImageLoader.lazyImage(img, url);
},
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index 9ef1a66969..ca02db40c4 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -763,10 +763,9 @@
curr.addEventListener('click', onCardClick);
if (AppInfo.isTouchPreferred) {
+
curr.removeEventListener('contextmenu', disableEvent);
curr.addEventListener('contextmenu', disableEvent);
- //this.off('contextmenu', onContextMenu);
- //this.on('contextmenu', onContextMenu);
}
else {
curr.removeEventListener('contextmenu', onContextMenu);
@@ -820,6 +819,7 @@
hammertime.on('press', onTapHold);
hammertime.on('pressup', onTapHoldUp);
});
+
showTapHoldHelp(element);
}
@@ -863,9 +863,16 @@
showSelections(card);
+ if (s.stopPropagation) {
+ e.stopPropagation();
+ }
e.preventDefault();
+ e.stopPropagation();
return false;
}
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
}
function onTapHoldUp(e) {
diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js
index 21c738caac..67c6d13205 100644
--- a/dashboard-ui/scripts/librarymenu.js
+++ b/dashboard-ui/scripts/librarymenu.js
@@ -272,7 +272,7 @@
var userAtTop = showUserAtTop();
- var homeHref = window.ApiClient ? 'index.html' : 'selectserver.html';
+ var homeHref = window.ApiClient ? 'index.html' : 'selectserver.html?showuser=1';
var hasUserImage = user.imageUrl && AppInfo.enableUserImage;
@@ -376,7 +376,7 @@
html += '