mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #1277 - Web: Wrong position of image and buttons during "Play To"
This commit is contained in:
parent
781f63d9ac
commit
b6040d998e
8 changed files with 92 additions and 164 deletions
|
@ -154,17 +154,8 @@ var Dashboard = {
|
|||
|
||||
if (info.HasPendingRestart) {
|
||||
|
||||
Dashboard.getCurrentUser().then(function (currentUser) {
|
||||
|
||||
if (currentUser.Policy.IsAdministrator) {
|
||||
Dashboard.showServerRestartWarning(info);
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
Dashboard.hideServerRestartWarning();
|
||||
|
||||
if (Dashboard.initialServerVersion != info.Version && !AppInfo.isNativeApp) {
|
||||
|
||||
window.location.reload(true);
|
||||
|
@ -172,98 +163,6 @@ var Dashboard = {
|
|||
}
|
||||
},
|
||||
|
||||
showServerRestartWarning: function (systemInfo) {
|
||||
|
||||
if (AppInfo.isNativeApp) {
|
||||
return;
|
||||
}
|
||||
|
||||
var html = '<span style="margin-right: 1em;">' + Globalize.translate('MessagePleaseRestart') + '</span>';
|
||||
|
||||
if (systemInfo.CanSelfRestart) {
|
||||
html += '<button is="emby-button" type="button" class="raised submit mini" onclick="this.disabled=\'disabled\';Dashboard.restartServer();"><i class="md-icon">refresh</i><span>' + Globalize.translate('ButtonRestart') + '</span></button>';
|
||||
}
|
||||
|
||||
Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false });
|
||||
},
|
||||
|
||||
hideServerRestartWarning: function () {
|
||||
|
||||
var elem = document.getElementById('serverRestartWarning');
|
||||
if (elem) {
|
||||
elem.parentNode.removeChild(elem);
|
||||
}
|
||||
},
|
||||
|
||||
showFooterNotification: function (options) {
|
||||
|
||||
var removeOnHide = !options.id;
|
||||
|
||||
options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
|
||||
|
||||
if (!document.querySelector(".footer")) {
|
||||
|
||||
var footerHtml = '<div id="footer" class="footer" data-theme="b" class="ui-bar-b">';
|
||||
|
||||
footerHtml += '<div id="footerNotifications"></div>';
|
||||
footerHtml += '</div>';
|
||||
|
||||
document.body.insertAdjacentHTML('beforeend', footerHtml);
|
||||
}
|
||||
|
||||
var footer = document.querySelector('.footer');
|
||||
footer.style.top = 'initial';
|
||||
footer.classList.remove('hide');
|
||||
|
||||
var parentElem = footer.querySelector('#footerNotifications');
|
||||
|
||||
var notificationElementId = 'notification' + options.id;
|
||||
|
||||
var elem = parentElem.querySelector('#' + notificationElementId);
|
||||
|
||||
if (!elem) {
|
||||
parentElem.insertAdjacentHTML('beforeend', '<p id="' + notificationElementId + '" class="footerNotification"></p>');
|
||||
elem = parentElem.querySelector('#' + notificationElementId);
|
||||
}
|
||||
|
||||
var onclick = removeOnHide ? "jQuery('#" + notificationElementId + "').trigger('notification.remove').remove();" : "jQuery('#" + notificationElementId + "').trigger('notification.hide').hide();";
|
||||
|
||||
if (options.allowHide !== false) {
|
||||
options.html += '<span style="margin-left: 1em;"><button is="emby-button" type="button" class="submit" onclick="' + onclick + '">' + Globalize.translate('ButtonHide') + "</button></span>";
|
||||
}
|
||||
|
||||
if (options.forceShow) {
|
||||
elem.classList.remove('hide');
|
||||
}
|
||||
|
||||
elem.innerHTML = options.html;
|
||||
|
||||
if (options.timeout) {
|
||||
|
||||
setTimeout(function () {
|
||||
|
||||
if (removeOnHide) {
|
||||
$(elem).trigger("notification.remove").remove();
|
||||
} else {
|
||||
$(elem).trigger("notification.hide").hide();
|
||||
}
|
||||
|
||||
}, options.timeout);
|
||||
}
|
||||
|
||||
$(footer).on("notification.remove notification.hide", function (e) {
|
||||
|
||||
setTimeout(function () { // give the DOM time to catch up
|
||||
|
||||
if (!parentElem.innerHTML) {
|
||||
footer.classList.add('hide');
|
||||
}
|
||||
|
||||
}, 50);
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
getConfigurationPageUrl: function (name) {
|
||||
return "configurationpage?name=" + encodeURIComponent(name);
|
||||
},
|
||||
|
@ -370,20 +269,6 @@ var Dashboard = {
|
|||
});
|
||||
},
|
||||
|
||||
refreshSystemInfoFromServer: function () {
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
if (apiClient && apiClient.accessToken()) {
|
||||
if (AppInfo.enableFooterNotifications) {
|
||||
apiClient.getSystemInfo().then(function (info) {
|
||||
|
||||
Dashboard.updateSystemInfo(info);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
restartServer: function () {
|
||||
|
||||
var apiClient = window.ApiClient;
|
||||
|
@ -698,13 +583,7 @@ var Dashboard = {
|
|||
|
||||
var msg = data;
|
||||
|
||||
if (msg.MessageType === "ServerShuttingDown") {
|
||||
Dashboard.hideServerRestartWarning();
|
||||
}
|
||||
else if (msg.MessageType === "ServerRestarting") {
|
||||
Dashboard.hideServerRestartWarning();
|
||||
}
|
||||
else if (msg.MessageType === "SystemInfo") {
|
||||
if (msg.MessageType === "SystemInfo") {
|
||||
Dashboard.updateSystemInfo(msg.Data);
|
||||
}
|
||||
else if (msg.MessageType === "RestartRequired") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue