mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
A few small UI fixes (#3310)
This commit is contained in:
parent
841db594c5
commit
7043bc566a
@ -225,7 +225,7 @@ export class GroupedTypeaheadComponent implements OnInit {
|
||||
close(event?: FocusEvent) {
|
||||
if (event) {
|
||||
// If the user is tabbing out of the input field, check if there are results first before closing
|
||||
if (this.hasData) {
|
||||
if (this.hasData || this.searchTerm) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,10 @@ export class ReadMoreComponent implements OnChanges {
|
||||
}
|
||||
|
||||
determineView() {
|
||||
const text = this.text ? this.text.replace(/\n/g, '<br>') : '';
|
||||
|
||||
if (!this.text || this.text.length <= this.maxLength) {
|
||||
this.currentText = this.text;
|
||||
this.currentText = text;
|
||||
this.isCollapsed = true;
|
||||
this.hideToggle = true;
|
||||
this.cdRef.markForCheck();
|
||||
@ -52,11 +54,11 @@ export class ReadMoreComponent implements OnChanges {
|
||||
|
||||
this.hideToggle = false;
|
||||
if (this.isCollapsed) {
|
||||
this.currentText = this.text.substring(0, this.maxLength);
|
||||
this.currentText = text.substring(0, this.maxLength);
|
||||
this.currentText = this.currentText.substring(0, Math.min(this.currentText.length, this.currentText.lastIndexOf(' ')));
|
||||
this.currentText = this.currentText + '…';
|
||||
} else if (!this.isCollapsed) {
|
||||
this.currentText = this.text;
|
||||
this.currentText = text;
|
||||
}
|
||||
|
||||
this.cdRef.markForCheck();
|
||||
|
Loading…
x
Reference in New Issue
Block a user