mirror of
https://github.com/IAmParadox27/jellyfin-plugin-media-bar.git
synced 2026-11-10 08:34:34 +01:00
Refactor play button creation to improve structure and maintainability
This commit is contained in:
1 parent
741e31ebd8
commit
d2f41f3910
1 file changed
+12
-5
+12
-5
@@ -2681,12 +2681,9 @@ const SlideCreator = {
|
||||
},
|
||||
|
||||
createPlayButton(itemId) {
|
||||
const playText = LocalizationUtils.getLocalizedString("Play", "Play");
|
||||
return SlideUtils.createElement("button", {
|
||||
|
||||
const button = SlideUtils.createElement("button", {
|
||||
className: "detailButton btnPlay play-button",
|
||||
innerHTML: `
|
||||
<span class="play-text">${playText}</span>
|
||||
`,
|
||||
tabIndex: "0",
|
||||
onclick: (e) => {
|
||||
e.preventDefault();
|
||||
@@ -2694,6 +2691,16 @@ const SlideCreator = {
|
||||
ApiUtils.playItem(itemId);
|
||||
},
|
||||
});
|
||||
|
||||
button.appendChild(
|
||||
SlideUtils.createElement(
|
||||
"span",
|
||||
{ className: "play-text" },
|
||||
LocalizationUtils.getLocalizedString("Play", "Play"),
|
||||
),
|
||||
);
|
||||
|
||||
return button;
|
||||
},
|
||||
|
||||
createDetailButton(itemId) {
|
||||
|
||||
Reference in new issue
Block a user