android_mt6572_jiabo/lineage/cve/static/js/Progress.js
2025-09-05 16:56:03 +08:00

27 lines
666 B
JavaScript

(function() {
function Progress(options) {
var p = this;
var container = options.container;
var element = options.element;
var valueField = options.valueField;
var value = options.value;
if (!value) {
value = 0;
}
p.set = function(newValue) {
newValue = limitValue(newValue, 0, 100);
element.style.width = newValue + '%';
valueField.innerHTML = Math.floor(newValue) + '%';
value = newValue;
};
p.get = function() {
return value;
};
p.set(value);
}
window.Progress = Progress;
})();