diff --git a/debian/changelog b/debian/changelog index af30e8ff..49c9c112 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (22.46.16) stable; urgency=low +hedera-web (22.46.17) stable; urgency=low * Initial Release. diff --git a/js/htk/select/index.js b/js/htk/select/index.js index f1059577..c45066df 100644 --- a/js/htk/select/index.js +++ b/js/htk/select/index.js @@ -139,13 +139,6 @@ module.exports = new Class({ this._refreshShowText(); this.iterChanged(); } - - ,_onEraseMouseDown(event) { - if (event.defaultPrevented) return; - event.preventDefault(); - this._setRow(-1); - this.valueChanged(undefined); - } ,_onButtonMouseDown(event) { if (this._popup) { @@ -197,12 +190,23 @@ module.exports = new Class({ else value = null; - this._setRow(row); - this.valueChanged(value); + this._setMyValue(row, value); this._popup.hide(); e.stopPropagation(); } + + ,_onEraseMouseDown(event) { + if (event.defaultPrevented) return; + event.preventDefault(); + this._setMyValue(-1, undefined); + } + + ,_setMyValue(row, value) { + this._myValue = value; + this._setRow(row); + this.valueChanged(value); + } ,_onPopupClose() { this._popup = null; @@ -210,16 +214,17 @@ module.exports = new Class({ } ,_refreshShowText() { - var model = this._model; - + const model = this._model; + let showText = ''; + if (this._row !== -1) - var showText = model.getByIndex(this._row, this.showColumnIndex); + showText = model.getByIndex(this._row, this.showColumnIndex); else if (model && model.status === Db.Model.Status.LOADING) - var showText = _('Loading...'); + showText = _('Loading...'); + else if (this._myValue != null) + showText = this._myValue; else if (this._placeholder) - var showText = this._placeholder; - else - var showText = ''; + showText = this._placeholder; Vn.Node.setText(this.label, showText); } @@ -246,7 +251,7 @@ module.exports = new Class({ var row; if (this._model && this._model.ready) - row = this._model.searchByIndex(this.valueColumnIndex, this._value); + row = this._model.searchByIndex(this.valueColumnIndex, this._myValue); else row = -1; @@ -254,6 +259,7 @@ module.exports = new Class({ } ,putValue() { + this._myValue = this._value; this._selectOption(); } }); diff --git a/package.json b/package.json index d52bf8ff..0ba0945a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "22.46.16", + "version": "22.46.17", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": {