migrate emby-progressbar, itemrefreshindicator, progressring and slider to ES6 modules
This commit is contained in:
parent
1f8ce6e6f4
commit
61af6779e5
5 changed files with 91 additions and 69 deletions
|
@ -1,20 +1,19 @@
|
|||
define([], function() {
|
||||
'use strict';
|
||||
/* eslint-disable indent */
|
||||
|
||||
var ProgressBarPrototype = Object.create(HTMLDivElement.prototype);
|
||||
let ProgressBarPrototype = Object.create(HTMLDivElement.prototype);
|
||||
|
||||
function onAutoTimeProgress() {
|
||||
var start = parseInt(this.getAttribute('data-starttime'));
|
||||
var end = parseInt(this.getAttribute('data-endtime'));
|
||||
const start = parseInt(this.getAttribute('data-starttime'));
|
||||
const end = parseInt(this.getAttribute('data-endtime'));
|
||||
|
||||
var now = new Date().getTime();
|
||||
var total = end - start;
|
||||
var pct = 100 * ((now - start) / total);
|
||||
const now = new Date().getTime();
|
||||
const total = end - start;
|
||||
let pct = 100 * ((now - start) / total);
|
||||
|
||||
pct = Math.min(100, pct);
|
||||
pct = Math.max(0, pct);
|
||||
|
||||
var itemProgressBarForeground = this.querySelector('.itemProgressBarForeground');
|
||||
const itemProgressBarForeground = this.querySelector('.itemProgressBarForeground');
|
||||
itemProgressBarForeground.style.width = pct + '%';
|
||||
}
|
||||
|
||||
|
@ -39,4 +38,5 @@ define([], function() {
|
|||
prototype: ProgressBarPrototype,
|
||||
extends: 'div'
|
||||
});
|
||||
});
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue