Improve progress_bar : add a blocking div
This commit is contained in:
parent
668b539d9d
commit
78fd828aa4
2 changed files with 35 additions and 5 deletions
|
|
@ -108,8 +108,20 @@ class Progress_Bar
|
|||
header('Content-Type: application/json');
|
||||
echo json_encode(["value"=>$this->value]);
|
||||
if ($this->value>=100) {
|
||||
$this->db->exec_sql("delete from progress where p_id=$1",[$this->task_id])
|
||||
$this->db->exec_sql("delete from progress where p_id=$1",[$this->task_id]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* increment value with $p_step
|
||||
* @param int $p_step
|
||||
*/
|
||||
function increment($p_step)
|
||||
{
|
||||
if ($this->value+$p_step > 100 ) {
|
||||
$this->set_value(100);
|
||||
return;
|
||||
}
|
||||
$this->set_value($this->value+$p_step);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue