last fixes for #26

This commit is contained in:
mProjectsCode 2022-06-21 17:26:32 +02:00
parent 61ebbc8599
commit 0a28acae7b
4 changed files with 33 additions and 7 deletions

View file

@ -46,7 +46,7 @@ export class MediaDbFolderImportModal extends Modal {
const appendContentToggleElementWrapper = contentEl.createEl('div', {cls: 'media-db-plugin-list-wrapper'});
const appendContentToggleTextWrapper = appendContentToggleElementWrapper.createEl('div', {cls: 'media-db-plugin-list-text-wrapper'});
appendContentToggleTextWrapper.createEl('span', {
text: 'If this is enabled, the plugin will override meta data fields with the same name.',
text: 'If this is enabled, the plugin will override metadata fields with the same name.',
cls: 'media-db-plugin-list-text',
});
@ -59,7 +59,7 @@ export class MediaDbFolderImportModal extends Modal {
contentEl.createDiv({cls: 'media-db-plugin-spacer'});
contentEl.createEl('h3', {text: 'The name of the mata data field that should be used as the title to query'});
contentEl.createEl('h3', {text: 'The name of the metadata field that should be used as the title to query.'});
const placeholder = 'title';
const titleFieldNameComponent = new TextComponent(contentEl);

View file

@ -72,11 +72,13 @@ export abstract class SelectModal<T> extends Modal {
contentEl.createEl('h2', {text: this.title});
contentEl.createEl('p', {text: this.description});
contentEl.addClass('media-db-plugin-select-modal');
const elementWrapper = contentEl.createDiv({cls: 'media-db-plugin-select-wrapper'});
let i = 0;
for (const element of this.elements) {
const selectModalElement = new SelectModalElement(element, contentEl, i, this, false);
const selectModalElement = new SelectModalElement(element, elementWrapper, i, this, false);
this.selectModalElements.push(selectModalElement);
@ -85,6 +87,8 @@ export abstract class SelectModal<T> extends Modal {
i += 1;
}
this.selectModalElements.first()?.element.scrollIntoView();
const bottomSetting = new Setting(contentEl);
bottomSetting.addButton(btn => btn.setButtonText('Cancel').onClick(() => this.close()));
if (this.skipButton) {