mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-17 20:11:23 +02:00
Fix bug in isDirty() causing error for some widgets, which broke onbeforeclose
This commit is contained in:
@@ -220,6 +220,7 @@ var et2_inputWidget = /** @class */ (function (_super) {
|
|||||||
return this._oldValue;
|
return this._oldValue;
|
||||||
};
|
};
|
||||||
et2_inputWidget.prototype.isDirty = function () {
|
et2_inputWidget.prototype.isDirty = function () {
|
||||||
|
var _a;
|
||||||
var value = this.getValue();
|
var value = this.getValue();
|
||||||
if (typeof value !== typeof this._oldValue) {
|
if (typeof value !== typeof this._oldValue) {
|
||||||
return true;
|
return true;
|
||||||
@@ -229,8 +230,10 @@ var et2_inputWidget = /** @class */ (function (_super) {
|
|||||||
}
|
}
|
||||||
switch (typeof this._oldValue) {
|
switch (typeof this._oldValue) {
|
||||||
case "object":
|
case "object":
|
||||||
if (this._oldValue.length !== value.length)
|
if (((_a = this._oldValue) === null || _a === void 0 ? void 0 : _a.length) && typeof this._oldValue.length !== "undefined" &&
|
||||||
|
this._oldValue.length !== value.length) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
for (var key in this._oldValue) {
|
for (var key in this._oldValue) {
|
||||||
if (this._oldValue[key] !== value[key])
|
if (this._oldValue[key] !== value[key])
|
||||||
return true;
|
return true;
|
||||||
|
@@ -324,7 +324,12 @@ export class et2_inputWidget extends et2_valueWidget implements et2_IInput, et2_
|
|||||||
switch(typeof this._oldValue)
|
switch(typeof this._oldValue)
|
||||||
{
|
{
|
||||||
case "object":
|
case "object":
|
||||||
if(this._oldValue.length !== value.length) return true;
|
if(this._oldValue?.length && typeof this._oldValue.length !== "undefined" &&
|
||||||
|
this._oldValue.length !== value.length
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for(let key in this._oldValue)
|
for(let key in this._oldValue)
|
||||||
{
|
{
|
||||||
if(this._oldValue[key] !== value[key]) return true;
|
if(this._oldValue[key] !== value[key]) return true;
|
||||||
|
Reference in New Issue
Block a user