0
1
Fork 0

refs #3971 Htk.Select: Display value when no row

This commit is contained in:
Juan Ferrer 2022-11-23 13:52:20 +01:00
parent ca61ee24ce
commit 8978172515
3 changed files with 25 additions and 19 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (22.46.16) stable; urgency=low
hedera-web (22.46.17) stable; urgency=low
* Initial Release.

View File

@ -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();
}
});

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "22.46.16",
"version": "22.46.17",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {