#2753 - Don't apply description text to autocomplete
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d61ab94398
commit
54a2ea31fa
|
@ -20,7 +20,7 @@ export default class Autocomplete extends Field {
|
||||||
constructor($element, $, $compile, $transclude) {
|
constructor($element, $, $compile, $transclude) {
|
||||||
super($element, $, $compile);
|
super($element, $, $compile);
|
||||||
this.$transclude = $transclude;
|
this.$transclude = $transclude;
|
||||||
|
this.$compile = $compile;
|
||||||
this._selection = null;
|
this._selection = null;
|
||||||
this.input = this.element.querySelector('input');
|
this.input = this.element.querySelector('input');
|
||||||
}
|
}
|
||||||
|
@ -185,8 +185,14 @@ export default class Autocomplete extends Field {
|
||||||
} else {
|
} else {
|
||||||
display = this._selection[this.showField];
|
display = this._selection[this.showField];
|
||||||
if (hasTemplate) {
|
if (hasTemplate) {
|
||||||
let template = this.$transclude(() => {}, null, 'tplItem').text();
|
let template = this.$transclude(() => {}, null, 'tplItem');
|
||||||
display = this.$interpolate(template)(this._selection);
|
const element = template[0];
|
||||||
|
const description = element.querySelector('.text-secondary');
|
||||||
|
if (description) description.remove();
|
||||||
|
|
||||||
|
const displayElement = angular.element(element);
|
||||||
|
const displayText = displayElement.text();
|
||||||
|
display = this.$interpolate(displayText)(this._selection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue