mirror of
https://github.com/jamescliffordspratt/macros.git
synced 2026-07-22 05:46:53 +00:00
Replace inline display styles with .macros-u-hidden class; setCssProps for tooltip
This commit is contained in:
parent
a5612daa35
commit
5c7a2164ef
4 changed files with 9 additions and 7 deletions
|
|
@ -20,7 +20,7 @@ export function registerProcessors(plugin: MacrosPlugin): void {
|
|||
// instead of falling back to showing their raw source.
|
||||
plugin.registerMarkdownCodeBlockProcessor('macrosmicro', (_source, el) => {
|
||||
el.empty();
|
||||
el.style.display = 'none';
|
||||
el.addClass('macros-u-hidden');
|
||||
});
|
||||
|
||||
plugin.logger.debug('All processors registered');
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ export class ManualFoodEntryModal extends Modal {
|
|||
|
||||
// Only show status section if we have added items
|
||||
if (this.addedItems.length > 0) {
|
||||
this.statusContainer.style.display = 'block';
|
||||
this.statusContainer.removeClass('macros-u-hidden');
|
||||
|
||||
const addedHeader = this.statusContainer.createDiv({ cls: 'added-items-header' });
|
||||
addedHeader.createEl('h3', {
|
||||
|
|
@ -265,7 +265,7 @@ export class ManualFoodEntryModal extends Modal {
|
|||
this.addedItemsList = this.statusContainer.createDiv({ cls: 'added-items-list' });
|
||||
this.updateAddedItemsDisplay();
|
||||
} else {
|
||||
this.statusContainer.style.display = 'none';
|
||||
this.statusContainer.addClass('macros-u-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -303,10 +303,10 @@ export class ManualFoodEntryModal extends Modal {
|
|||
|
||||
// Show/hide status section based on items
|
||||
if (this.addedItems.length > 0) {
|
||||
this.statusContainer.style.display = 'block';
|
||||
this.statusContainer.removeClass('macros-u-hidden');
|
||||
this.updateAddedItemsDisplay();
|
||||
} else {
|
||||
this.statusContainer.style.display = 'none';
|
||||
this.statusContainer.addClass('macros-u-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -326,7 +326,7 @@ export class ManualFoodEntryModal extends Modal {
|
|||
});
|
||||
|
||||
const body = section.createDiv({ cls: 'micronutrient-entry-body' });
|
||||
body.style.display = 'none';
|
||||
body.addClass('macros-u-hidden');
|
||||
|
||||
let expanded = false;
|
||||
const toggle = () => {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function ensureTooltipEl(): HTMLDivElement {
|
|||
if (!tooltipEl) {
|
||||
tooltipEl = activeDocument.createElement('div');
|
||||
tooltipEl.className = 'macro-tooltip macro-tooltip-hidden';
|
||||
tooltipEl.setAttribute('style', '--x: -9999px; --y: -9999px;');
|
||||
tooltipEl.setCssProps({ '--x': '-9999px', '--y': '-9999px' });
|
||||
activeDocument.body.appendChild(tooltipEl);
|
||||
}
|
||||
return tooltipEl;
|
||||
|
|
|
|||
|
|
@ -9292,3 +9292,5 @@ body:not(.theme-obsidian) .api-credentials-success {
|
|||
font-size: 0.75rem;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
.macros-u-hidden { display: none !important; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue