From 8debf18984d2a15bfc384ce9da9ca3b74bb3fcc5 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 5 Jun 2021 14:12:17 +0200 Subject: [PATCH] added plugin buttons to the launcher pane --- src/public/app/layouts/desktop_layout.js | 8 +++++-- .../app/services/frontend_script_api.js | 22 +++++++++++-------- src/public/app/widgets/spacer.js | 8 +++++-- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 719d0e077..c282b16df 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -69,7 +69,11 @@ export default class DesktopLayout { .icon("bx-history") .title("Show recent changes") .command("showRecentChanges")) - .child(new SpacerWidget()) + .child(new SpacerWidget(40, 0)) + .child(new FlexContainer("column") + .overflowing() + .id("plugin-buttons")) + .child(new SpacerWidget(0, 1000)) .child(new ProtectedSessionStatusWidget()) .child(new SyncStatusWidget()) .child(new LeftPaneToggleWidget()) @@ -103,7 +107,7 @@ export default class DesktopLayout { .overflowing() .child(new NoteIconWidget()) .child(new NoteTitleWidget()) - .child(new SpacerWidget(1)) + .child(new SpacerWidget(0, 1)) .child(new ClosePaneButton()) .child(new CreatePaneButton()) ) diff --git a/src/public/app/services/frontend_script_api.js b/src/public/app/services/frontend_script_api.js index 43b4cf76a..31ee842c0 100644 --- a/src/public/app/services/frontend_script_api.js +++ b/src/public/app/services/frontend_script_api.js @@ -112,19 +112,23 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain .on('click', () => { setTimeout(() => $pluginButtons.dropdown('hide'), 0); }); + + if (opts.icon) { + button.append($("").addClass("bx bx-" + opts.icon)) + .append(" "); + } + + button.append($("").text(opts.title)); } else { - button = $('