hide existing, Replacement labels on mobile, we are having placeholders here

This commit is contained in:
Oleh Lustenko 2022-09-10 10:30:37 +03:00
parent 1d6add95ac
commit 7011bfd989
1 changed files with 23 additions and 6 deletions

25
main.ts
View File

@ -1,4 +1,11 @@
import { App, Plugin, PluginSettingTab, Setting, TFile } from 'obsidian';
import {
App,
Plugin,
PluginSettingTab,
Setting,
TFile,
Platform,
} from 'obsidian';
import { FolderSuggest } from './src/suggestions/folderSuggest';
import { renderDonateButton } from './src/components/DonateButton';
@ -185,10 +192,15 @@ export class BulkRenameSettingsTab extends PluginSettingTab {
newSettings.infoEl.style.display = 'none';
newSettings.addText((textComponent) => {
if (Platform.isDesktop) {
const previewLabel = createPreviewElement('Existing');
textComponent.inputEl.insertAdjacentElement('beforebegin', previewLabel);
textComponent.inputEl.insertAdjacentElement(
'beforebegin',
previewLabel,
);
}
textComponent.setValue(settings.existingSymbol);
textComponent.setPlaceholder('existing symbols');
textComponent.setPlaceholder('existing chars');
textComponent.onChange((newValue) => {
settings.existingSymbol = newValue;
this.plugin.saveSettings();
@ -198,8 +210,13 @@ export class BulkRenameSettingsTab extends PluginSettingTab {
});
newSettings.addText((textComponent) => {
if (Platform.isDesktop) {
const previewLabel = createPreviewElement('Replacement');
textComponent.inputEl.insertAdjacentElement('beforebegin', previewLabel);
textComponent.inputEl.insertAdjacentElement(
'beforebegin',
previewLabel,
);
}
textComponent.setValue(settings.replacePattern);
textComponent.setPlaceholder('replace with');
textComponent.onChange((newValue) => {