[Fix] Fixed confirmation callback firing

This commit is contained in:
Robert von Burg 2021-03-03 13:38:20 +01:00
parent 66bbee592a
commit aa74b372a7
2 changed files with 6 additions and 12 deletions

View File

@ -1,7 +1,7 @@
{
"name": "strolch-wc-plc",
"description": "Strolch PLC WebComponents",
"version": "0.3.8",
"version": "0.3.9",
"authors": ["Robert von Burg"],
"keywords": [
"strolch",

View File

@ -85,24 +85,18 @@
confirmActionWarning: function (callback) {
var bound = callback.bind(this);
if (this.warningConfirmed) {
bound();
return;
}
var confirmedCallback = function (confirmed) {
if (confirmed) {
this.fire("cx-show-info", {
title: this.localize('confirmActionWarning'),
line1: this.localize('confirmActionWarningMsg'),
callback: function () {
this.warningConfirmed = true;
bound();
}
}.bind(this);
this.fire("cx-show-confirmation", {
title: this.localize('confirmActionWarning'),
text: this.localize('confirmActionWarningMsg'),
callback: confirmedCallback,
bind: this
}.bind(this)
});
}
}