mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
improve button style when focused
This commit is contained in:
parent
52136b57a2
commit
54ca2e9381
22 changed files with 148 additions and 196 deletions
|
@ -21,30 +21,23 @@ define(['browser', 'dom', 'layoutManager', 'shell', 'appRouter', 'apphost', 'css
|
|||
}
|
||||
|
||||
EmbyButtonPrototype.createdCallback = function () {
|
||||
|
||||
if (this.classList.contains('emby-button')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.classList.add('emby-button');
|
||||
|
||||
if (layoutManager.tv) {
|
||||
if (this.getAttribute('data-focusscale') !== 'false') {
|
||||
this.classList.add('emby-button-focusscale');
|
||||
}
|
||||
this.classList.add('emby-button-tv');
|
||||
// handles all special css for tv layout
|
||||
// the old method was element-showfocus
|
||||
// this method utilizes class chaining instead
|
||||
this.classList.add('show-focus');
|
||||
}
|
||||
};
|
||||
|
||||
EmbyButtonPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.tagName === 'A') {
|
||||
|
||||
dom.removeEventListener(this, 'click', onAnchorClick, {
|
||||
});
|
||||
|
||||
dom.addEventListener(this, 'click', onAnchorClick, {
|
||||
});
|
||||
dom.removeEventListener(this, 'click', onAnchorClick, {});
|
||||
dom.addEventListener(this, 'click', onAnchorClick, {});
|
||||
|
||||
if (this.getAttribute('data-autohide') === 'true') {
|
||||
if (appHost.supports('externallinks')) {
|
||||
|
@ -57,9 +50,7 @@ define(['browser', 'dom', 'layoutManager', 'shell', 'appRouter', 'apphost', 'css
|
|||
};
|
||||
|
||||
EmbyButtonPrototype.detachedCallback = function () {
|
||||
|
||||
dom.removeEventListener(this, 'click', onAnchorClick, {
|
||||
});
|
||||
dom.removeEventListener(this, 'click', onAnchorClick, {});
|
||||
};
|
||||
|
||||
EmbyLinkButtonPrototype.createdCallback = EmbyButtonPrototype.createdCallback;
|
||||
|
@ -75,6 +66,5 @@ define(['browser', 'dom', 'layoutManager', 'shell', 'appRouter', 'apphost', 'css
|
|||
extends: 'a'
|
||||
});
|
||||
|
||||
// For extension purposes
|
||||
return EmbyButtonPrototype;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue