Skip to content

Commit

Permalink
hide existing, Replacement labels on mobile, we are having placeholde…
Browse files Browse the repository at this point in the history
…rs here
  • Loading branch information
Oleh Lustenko committed Sep 10, 2022
1 parent 1d6add9 commit 7011bfd
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions main.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -185,10 +192,15 @@ export class BulkRenameSettingsTab extends PluginSettingTab {
newSettings.infoEl.style.display = 'none';

newSettings.addText((textComponent) => {
const previewLabel = createPreviewElement('Existing');
textComponent.inputEl.insertAdjacentElement('beforebegin', previewLabel);
if (Platform.isDesktop) {
const previewLabel = createPreviewElement('Existing');
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();
Expand All @@ -198,8 +210,13 @@ export class BulkRenameSettingsTab extends PluginSettingTab {
});

newSettings.addText((textComponent) => {
const previewLabel = createPreviewElement('Replacement');
textComponent.inputEl.insertAdjacentElement('beforebegin', previewLabel);
if (Platform.isDesktop) {
const previewLabel = createPreviewElement('Replacement');
textComponent.inputEl.insertAdjacentElement(
'beforebegin',
previewLabel,
);
}
textComponent.setValue(settings.replacePattern);
textComponent.setPlaceholder('replace with');
textComponent.onChange((newValue) => {
Expand Down

0 comments on commit 7011bfd

Please sign in to comment.