mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
Add span for position text node
This commit is contained in:
parent
cf9f46ba35
commit
87bee50c20
1 changed files with 3 additions and 6 deletions
|
@ -10,7 +10,7 @@
|
||||||
<button id="play-pause-button"></button>
|
<button id="play-pause-button"></button>
|
||||||
<input id="progress" type="range" value="0" min="0" max="100" step="1"></input>
|
<input id="progress" type="range" value="0" min="0" max="100" step="1"></input>
|
||||||
<span id="position-duration-box" class="hidden">
|
<span id="position-duration-box" class="hidden">
|
||||||
#1
|
<span id="position-text">#1</span>
|
||||||
<span id="duration"> / #2</span>
|
<span id="duration"> / #2</span>
|
||||||
</span>
|
</span>
|
||||||
<button id="volume-switch"></button>
|
<button id="volume-switch"></button>
|
||||||
|
@ -91,6 +91,7 @@
|
||||||
"duration",
|
"duration",
|
||||||
"play-pause-button",
|
"play-pause-button",
|
||||||
"position-duration-box",
|
"position-duration-box",
|
||||||
|
"position-text",
|
||||||
"progress",
|
"progress",
|
||||||
"volume-switch",
|
"volume-switch",
|
||||||
"volume-level"
|
"volume-level"
|
||||||
|
@ -99,17 +100,13 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// Init position duration box.
|
// Init position duration box.
|
||||||
const positionTextNode = Array.prototype.find.call(
|
const positionTextNode = this.elements.positionText;
|
||||||
this.elements.positionDurationBox.childNodes,
|
|
||||||
(n) => !!~n.textContent.search("#1")
|
|
||||||
);
|
|
||||||
const durationSpan = this.elements.duration;
|
const durationSpan = this.elements.duration;
|
||||||
const durationFormat = durationSpan.textContent;
|
const durationFormat = durationSpan.textContent;
|
||||||
const positionFormat = positionTextNode.textContent;
|
const positionFormat = positionTextNode.textContent;
|
||||||
|
|
||||||
durationSpan.classList.add("duration");
|
durationSpan.classList.add("duration");
|
||||||
durationSpan.setAttribute("role", "none");
|
durationSpan.setAttribute("role", "none");
|
||||||
durationSpan.id = "durationSpan";
|
|
||||||
|
|
||||||
Object.defineProperties(this.elements.positionDurationBox, {
|
Object.defineProperties(this.elements.positionDurationBox, {
|
||||||
durationSpan: {
|
durationSpan: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue