-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] The buttons on the left panel are displayed incorrectly. #230
Comments
The issue is in configureRibbonIcons:
it only looks at configuredGranularities[0] and so only the first active Granularity is added after the Layout is ready. I've worked around this with 2 active configurations one with daily/weekly the other weekly only, and a hotkey to swap between them. After load I push that. ribbonEl isn't an array so I didn't easily fix this. |
Workaround. Edit this file and then you can set the options you want and restart Obsidian for them to take effect. In configureRibbonIcons() {
var _a;
(_a = this.ribbonEl) === null || _a === void 0 ? void 0 : _a.detach();
const configuredPeriodicities = [
"daily",
"weekly",
"monthly",
"quarterly",
"yearly",
].filter((periodicity) => this.settings[periodicity].enabled);
if (configuredPeriodicities.length) {
const periodicity = configuredPeriodicities[0];
const config = periodConfigs[periodicity];
this.ribbonEl = this.addRibbonIcon(`calendar-${config.unitOfTime}`, `Open ${config.relativeUnit}`, (event) => openPeriodicNote(periodicity, window.moment(), isMetaPressed(event)));
this.ribbonEl.addEventListener("contextmenu", (ev) => {
showFileMenu(this.app, this.settings, {
x: ev.pageX,
y: ev.pageY,
});
});
}
} to configureRibbonIcons() {
var _a;
(_a = this.ribbonEl) === null || _a === void 0 ? void 0 : _a.detach();
const configuredPeriodicities = [
"daily",
"weekly",
"monthly",
"quarterly",
"yearly",
].filter((periodicity) => this.settings[periodicity].enabled);
for (const periodicity of configuredPeriodicities) {
const config = periodConfigs[periodicity];
this.ribbonEl = this.addRibbonIcon(`calendar-${config.unitOfTime}`, `Open ${config.relativeUnit}`, (event) => openPeriodicNote(periodicity, window.moment(), isMetaPressed(event)));
this.ribbonEl.addEventListener("contextmenu", (ev) => {
showFileMenu(this.app, this.settings, {
x: ev.pageX,
y: ev.pageY,
});
});
}
} |
If all buttons are enabled, they are displayed incorrectly on the left panel. This is noticeable when the program is restarted.
Another extension, "Commander", helps me solve this problem.
Obsidian_rB6TqK8R2o_1222.mp4
The text was updated successfully, but these errors were encountered: