mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Add onFinish callback to countdown widget and style it
This commit is contained in:
parent
65b24440a0
commit
54eb66fd30
@ -70,8 +70,11 @@ var et2_countdown = /** @class */ (function (_super) {
|
||||
this.time.set_value(_time);
|
||||
var self = this;
|
||||
this.timer = setInterval(function () {
|
||||
if (self._updateTimer() <= 0)
|
||||
clearInterval(this.timer);
|
||||
if (self._updateTimer() <= 0) {
|
||||
clearInterval(self.timer);
|
||||
if (typeof self.onFinish == "function")
|
||||
self.onFinish();
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
et2_countdown.prototype._updateTimer = function () {
|
||||
@ -102,6 +105,12 @@ var et2_countdown = /** @class */ (function (_super) {
|
||||
type: "string",
|
||||
default: "s",
|
||||
description: "Defines display format; s (Initial letter) or l (Complete word) display, default is s."
|
||||
},
|
||||
onFinish: {
|
||||
name: "on finish countdown",
|
||||
type: "js",
|
||||
default: et2_no_init,
|
||||
description: "Callback function to call when the countdown is finished."
|
||||
}
|
||||
};
|
||||
return et2_countdown;
|
||||
|
@ -35,6 +35,12 @@ export class et2_countdown extends et2_baseWidget {
|
||||
type: "string",
|
||||
default: "s", // s or l
|
||||
description: "Defines display format; s (Initial letter) or l (Complete word) display, default is s."
|
||||
},
|
||||
onFinish: {
|
||||
name: "on finish countdown",
|
||||
type: "js",
|
||||
default: et2_no_init,
|
||||
description: "Callback function to call when the countdown is finished."
|
||||
}
|
||||
};
|
||||
|
||||
@ -76,7 +82,11 @@ export class et2_countdown extends et2_baseWidget {
|
||||
this.time.set_value(_time);
|
||||
let self = this;
|
||||
this.timer = setInterval(function(){
|
||||
if (self._updateTimer() <= 0) clearInterval(this.timer);
|
||||
if (self._updateTimer() <= 0)
|
||||
{
|
||||
clearInterval(self.timer);
|
||||
if (typeof self.onFinish == "function") self.onFinish();
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
@ -3282,4 +3282,14 @@ tr.disableIfNoEPL {
|
||||
}
|
||||
.colselection.ui-widget-content .et2_selectbox .ui-multiselect-checkboxes {
|
||||
height: calc(100% - 68px) !important;
|
||||
}
|
||||
.et2_countdown {
|
||||
margin-left: 10px;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
.et2_countdown > span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
span.et2_countdown_seconds {
|
||||
margin-right: 0px;
|
||||
}
|
Loading…
Reference in New Issue
Block a user