1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-08 03:14:13 +01:00

Fix some crufty old mode-change related bugginess.

This commit is contained in:
Kris Maglione
2010-10-04 14:17:13 -04:00
parent f141d3921b
commit af64937d55
7 changed files with 165 additions and 163 deletions

View File

@@ -169,26 +169,31 @@ const StatusLine = Module("statusline", {
* A number n <= 0 - Displayed as a "Loading" message.
* Any other number - The progress is cleared.
*/
updateProgress: function updateProgress(progress) {
if (!progress)
progress = "";
progress: Modes.boundProperty({
set: function setProgress(progress) {
if (!progress)
progress = "";
if (typeof progress == "string")
this.widgets.progress.value = progress;
else if (typeof progress == "number") {
let progressStr = "";
if (progress <= 0)
progressStr = "[ Loading... ]";
else if (progress < 1) {
progress = Math.floor(progress * 20);
progressStr = "["
+ "====================".substr(0, progress)
+ ">"
+ " ".substr(0, 19 - progress)
+ "]";
if (typeof progress == "string")
this.widgets.progress.value = progress;
else if (typeof progress == "number") {
let progressStr = "";
if (progress <= 0)
progressStr = "[ Loading... ]";
else if (progress < 1) {
progress = Math.floor(progress * 20);
progressStr = "["
+ "====================".substr(0, progress)
+ ">"
+ " ".substr(0, 19 - progress)
+ "]";
}
this.widgets.progress.value = progressStr;
}
this.widgets.progress.value = progressStr;
}
}),
updateProgress: function updateProgress(progress) {
this.progress = progress;
},
/**