Implement resizable progress bar in "Done" column

This commit is contained in:
buinsky 2016-12-18 07:40:46 +03:00
parent 09cf93521f
commit d50a7778fe
2 changed files with 25 additions and 1 deletions

View file

@ -59,6 +59,7 @@ var ProgressBar = new Class({
obj.appendChild(obj.vals.light);
obj.getValue = ProgressBar_getValue;
obj.setValue = ProgressBar_setValue;
obj.setWidth = ProgressBar_setWidth;
if (vals.width) obj.setValue(vals.value);
else setTimeout('ProgressBar_checkForParent("' + obj.id + '")', 1);
return obj;
@ -84,6 +85,16 @@ function ProgressBar_setValue(value) {
this.vals.light.setStyle('clip', 'rect(0,' + this.vals.width + 'px,' + this.vals.height + 'px,' + r + 'px)');
}
function ProgressBar_setWidth(value) {
if (this.vals.width !== value) {
this.vals.width = value;
this.setStyle('width', value);
this.vals.dark.setStyle('width', value);
this.vals.light.setStyle('width', value);
this.setValue(this.vals.value);
}
}
function ProgressBar_checkForParent(id) {
var obj = $(id);
if (!obj) return;