mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 09:56:36 +00:00
feat: add back-and-forth animation for media title and artist overflow labels
This commit is contained in:
@@ -168,9 +168,22 @@ class ZenMediaController {
|
||||
},
|
||||
{}
|
||||
);
|
||||
this.addLabelOverflows();
|
||||
});
|
||||
}
|
||||
|
||||
addLabelOverflows() {
|
||||
const elements = [this.mediaTitle, this.mediaArtist];
|
||||
for (const element of elements) {
|
||||
const parent = element.parentElement;
|
||||
if (element.scrollWidth > parent.clientWidth) {
|
||||
element.setAttribute('overflow', '');
|
||||
} else {
|
||||
element.removeAttribute('overflow');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setupMediaController(mediaController, browser) {
|
||||
this._currentMediaController = mediaController;
|
||||
this._currentBrowser = browser;
|
||||
|
Reference in New Issue
Block a user