Skip to content

Commit 78c7dd8

Browse files
committed
fix for requested changes - uses textContent instead of innterHTML to display date preview in settings panel, also prefixed element id with media-db
1 parent 52309dd commit 78c7dd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/settings/Settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ export class MediaDbSettingTab extends PluginSettingTab {
172172
.setName('Date format')
173173
.setDesc(fragWithHTML("Your custom date format. Use <em>\'YYYY-MM-DD\'</em> for example.<br>" +
174174
"For more syntax, refer to <a href='https://momentjs.com/docs/#/displaying/format/'>format reference</a>.<br>" +
175-
"Your current syntax looks like this: <b><a id='dateformat-preview' style='pointer-events: none; cursor: default; text-decoration: none;'>" +
175+
"Your current syntax looks like this: <b><a id='media-db-dateformat-preview' style='pointer-events: none; cursor: default; text-decoration: none;'>" +
176176
this.plugin.dateFormatter.getPreview() + "</a></b>"))
177177
.addText(cb => {
178178
cb.setPlaceholder(DEFAULT_SETTINGS.customDateFormat)
179179
.setValue(this.plugin.settings.customDateFormat === DEFAULT_SETTINGS.customDateFormat ? '' : this.plugin.settings.customDateFormat)
180180
.onChange(data => {
181181
const newDateFormat = data ? data : DEFAULT_SETTINGS.customDateFormat;
182182
this.plugin.settings.customDateFormat = newDateFormat;
183-
document.getElementById('dateformat-preview').innerHTML = this.plugin.dateFormatter.getPreview(newDateFormat); // update preview
183+
document.getElementById('media-db-dateformat-preview').textContent = this.plugin.dateFormatter.getPreview(newDateFormat); // update preview
184184
this.plugin.saveSettings();
185185
});
186186
});

0 commit comments

Comments
 (0)