1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

simplify some css rules

This commit is contained in:
dkanada 2019-05-23 03:02:18 -07:00
parent 5135fd37b3
commit 63b4249c34
5 changed files with 22 additions and 94 deletions

View file

@ -181,10 +181,8 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
} }
function onSeriesTimerCreated(e, apiClient, data) { function onSeriesTimerCreated(e, apiClient, data) {
var itemsContainer = this; var itemsContainer = this;
if (getEventsToMonitor(itemsContainer).indexOf('seriestimers') !== -1) { if (getEventsToMonitor(itemsContainer).indexOf('seriestimers') !== -1) {
itemsContainer.notifyRefreshNeeded(); itemsContainer.notifyRefreshNeeded();
return; return;
} }
@ -192,42 +190,33 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
function onTimerCancelled(e, apiClient, data) { function onTimerCancelled(e, apiClient, data) {
var itemsContainer = this; var itemsContainer = this;
if (getEventsToMonitor(itemsContainer).indexOf('timers') !== -1) { if (getEventsToMonitor(itemsContainer).indexOf('timers') !== -1) {
itemsContainer.notifyRefreshNeeded(); itemsContainer.notifyRefreshNeeded();
return; return;
} }
var id = data.Id;
require(['cardBuilder'], function (cardBuilder) { require(['cardBuilder'], function (cardBuilder) {
cardBuilder.onTimerCancelled(id, itemsContainer); cardBuilder.onTimerCancelled(data.Id, itemsContainer);
}); });
} }
function onSeriesTimerCancelled(e, apiClient, data) { function onSeriesTimerCancelled(e, apiClient, data) {
var itemsContainer = this; var itemsContainer = this;
if (getEventsToMonitor(itemsContainer).indexOf('seriestimers') !== -1) { if (getEventsToMonitor(itemsContainer).indexOf('seriestimers') !== -1) {
itemsContainer.notifyRefreshNeeded(); itemsContainer.notifyRefreshNeeded();
return; return;
} }
var id = data.Id;
require(['cardBuilder'], function (cardBuilder) { require(['cardBuilder'], function (cardBuilder) {
cardBuilder.onSeriesTimerCancelled(id, itemsContainer); cardBuilder.onSeriesTimerCancelled(data.Id, itemsContainer);
}); });
} }
function onLibraryChanged(e, apiClient, data) { function onLibraryChanged(e, apiClient, data) {
var itemsContainer = this; var itemsContainer = this;
var eventsToMonitor = getEventsToMonitor(itemsContainer); var eventsToMonitor = getEventsToMonitor(itemsContainer);
if (eventsToMonitor.indexOf('seriestimers') !== -1 || eventsToMonitor.indexOf('timers') !== -1) { if (eventsToMonitor.indexOf('seriestimers') !== -1 || eventsToMonitor.indexOf('timers') !== -1) {
// yes this is an assumption // yes this is an assumption
return; return;
} }
@ -253,25 +242,17 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
} }
function onPlaybackStopped(e, stopInfo) { function onPlaybackStopped(e, stopInfo) {
var itemsContainer = this; var itemsContainer = this;
var state = stopInfo.state; var state = stopInfo.state;
var eventsToMonitor = getEventsToMonitor(itemsContainer); var eventsToMonitor = getEventsToMonitor(itemsContainer);
if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Video') { if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Video') {
if (eventsToMonitor.indexOf('videoplayback') !== -1) { if (eventsToMonitor.indexOf('videoplayback') !== -1) {
itemsContainer.notifyRefreshNeeded(true); itemsContainer.notifyRefreshNeeded(true);
return; return;
} }
} } else if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Audio') {
else if (state.NowPlayingItem && state.NowPlayingItem.MediaType === 'Audio') {
if (eventsToMonitor.indexOf('audioplayback') !== -1) { if (eventsToMonitor.indexOf('audioplayback') !== -1) {
itemsContainer.notifyRefreshNeeded(true); itemsContainer.notifyRefreshNeeded(true);
return; return;
} }
@ -279,7 +260,6 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
} }
function addNotificationEvent(instance, name, handler, owner) { function addNotificationEvent(instance, name, handler, owner) {
var localHandler = handler.bind(instance); var localHandler = handler.bind(instance);
owner = owner || serverNotifications; owner = owner || serverNotifications;
events.on(owner, name, localHandler); events.on(owner, name, localHandler);
@ -287,7 +267,6 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
} }
function removeNotificationEvent(instance, name, owner) { function removeNotificationEvent(instance, name, owner) {
var handler = instance['event_' + name]; var handler = instance['event_' + name];
if (handler) { if (handler) {
owner = owner || serverNotifications; owner = owner || serverNotifications;
@ -297,12 +276,10 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
} }
ItemsContainerPrototype.createdCallback = function () { ItemsContainerPrototype.createdCallback = function () {
this.classList.add('itemsContainer'); this.classList.add('itemsContainer');
}; };
ItemsContainerPrototype.attachedCallback = function () { ItemsContainerPrototype.attachedCallback = function () {
this.addEventListener('click', onClick); this.addEventListener('click', onClick);
if (browser.touch) { if (browser.touch) {
@ -346,6 +323,7 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
this.removeEventListener('click', onClick); this.removeEventListener('click', onClick);
this.removeEventListener('contextmenu', onContextMenu); this.removeEventListener('contextmenu', onContextMenu);
this.removeEventListener('contextmenu', disableEvent); this.removeEventListener('contextmenu', disableEvent);
itemShortcuts.off(this, getShortcutOptions()); itemShortcuts.off(this, getShortcutOptions());
removeNotificationEvent(this, 'UserDataChanged'); removeNotificationEvent(this, 'UserDataChanged');
@ -374,9 +352,7 @@ define(['itemShortcuts', 'inputManager', 'connectionManager', 'playbackManager',
var remainingMs = refreshIntervalEndTime - new Date().getTime(); var remainingMs = refreshIntervalEndTime - new Date().getTime();
if (remainingMs > 0 && !this.needsRefresh) { if (remainingMs > 0 && !this.needsRefresh) {
resetRefreshInterval(this, remainingMs); resetRefreshInterval(this, remainingMs);
} else { } else {
this.needsRefresh = true; this.needsRefresh = true;
this.refreshIntervalEndTime = null; this.refreshIntervalEndTime = null;

View file

@ -3,8 +3,8 @@
} }
.emby-scroller { .emby-scroller {
margin-left: 3.3%; margin-left: 4em;
margin-right: 3.3%; margin-right: 4em;
} }
.emby-scrollbuttons { .emby-scrollbuttons {

View file

@ -33,7 +33,8 @@ define(['layoutManager', 'dom', 'css!./emby-scrollbuttons', 'registerElement', '
} }
function updateScrollButtons(scrollButtons, scrollSize, scrollPos, scrollWidth) { function updateScrollButtons(scrollButtons, scrollSize, scrollPos, scrollWidth) {
if (scrollWidth <= scrollSize) { // hack alert add ten for rounding errors
if (scrollWidth <= scrollSize + 10) {
scrollButtons.scrollButtonsLeft.classList.add('hide'); scrollButtons.scrollButtonsLeft.classList.add('hide');
scrollButtons.scrollButtonsRight.classList.add('hide'); scrollButtons.scrollButtonsRight.classList.add('hide');
} }

View file

@ -372,8 +372,9 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
var html = ''; var html = '';
if (userViews.length) { if (userViews.length) {
html += '<div class="sectionTitleContainer sectionTitleContainer-cards">'; html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + globalize.translate('HeaderMyMedia') + '</h2>'; html += '<h2 class="sectionTitle sectionTitle-cards">' + globalize.translate('HeaderMyMedia') + '</h2>';
html += '</div>';
if (enableScrollX()) { if (enableScrollX()) {
html += '<div is="emby-scroller" class="padded-top-focusscale padded-bottom-focusscale" data-mousewheel="false" data-centerfocus="true">'; html += '<div is="emby-scroller" class="padded-top-focusscale padded-bottom-focusscale" data-mousewheel="false" data-centerfocus="true">';

View file

@ -960,97 +960,47 @@
} }
.padded-left { .padded-left {
padding-left: 2% padding-left: 4em;
} }
.padded-right { .padded-right {
padding-right: 2% padding-right: 4em;
} }
.padded-top { .padded-top {
padding-top: 1em padding-top: 1em;
} }
.padded-bottom { .padded-bottom {
padding-bottom: 1em padding-bottom: 1em;
} }
.layout-tv .padded-top-focusscale { .layout-tv .padded-top-focusscale {
padding-top: 1em; padding-top: 1em;
margin-top: -1em margin-top: -1em;
} }
.layout-tv .padded-bottom-focusscale { .layout-tv .padded-bottom-focusscale {
padding-bottom: 1em; padding-bottom: 1em;
margin-bottom: -1em margin-bottom: -1em;
} }
@media all and (min-height:31.25em) { @media all and (min-height:31.25em) {
.padded-left-withalphapicker { .padded-left-withalphapicker {
padding-left: 7.5% padding-left: 7.5%;
} }
.padded-right-withalphapicker { .padded-right-withalphapicker {
padding-right: 7.5% padding-right: 7.5%;
}
}
@media all and (min-width:31.25em) {
.padded-left {
padding-left: 6%
}
.padded-right {
padding-right: 6%
}
}
@media all and (min-width:37.5em) {
.padded-left {
padding-left: 4%
}
.padded-right {
padding-right: 4%
}
}
@media all and (min-width:50em) {
.padded-left {
padding-left: 3.2%
}
.padded-right {
padding-right: 3.2%
}
}
@media all and (min-width:64em) {
.padded-left {
padding-left: 3.3%
}
.padded-right {
padding-right: 3.3%
}
}
@media all and (min-width:50em) {
.layout-tv .padded-left-withalphapicker {
padding-left: 4.5%
}
.layout-tv .padded-right-withalphapicker {
padding-right: 4.5%
} }
} }
.searchfields-icon { .searchfields-icon {
color: #aaa color: #aaaaaa;
} }
.button-accent-flat { .button-accent-flat {
color: #00a4dc !important color: #00a4dc !important;
} }
.clearLink { .clearLink {