Skip to content
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

feat: open a new tab when clicking on the menu and submenu. #632

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,8 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S
('theme', 'Set to "dark" to use a dark theme.', 'TEXT', TRUE, TRUE),
('footer', 'Muted text to display in the footer of the page. This can be used to display a link to the terms and conditions of your application, for instance. By default, shows "Built with SQLPage". Supports links with markdown.', 'TEXT', TRUE, TRUE),
('preview_image', 'The URL of an image to display as a link preview when the page is shared on social media', 'URL', TRUE, TRUE),
('navbar_title', 'The title to display in the top navigation bar. Used to display a different title in the top menu than the one that appears in the tab of the browser.', 'TEXT', TRUE, TRUE)
('navbar_title', 'The title to display in the top navigation bar. Used to display a different title in the top menu than the one that appears in the tab of the browser.', 'TEXT', TRUE, TRUE),
('target', '"_blank" to open the link in a new tab, "_self" to open it in the same tab, "_parent" to open it in the parent frame, or "_top" to open it in the full body of the window', 'TEXT', TRUE, TRUE)
) x;

INSERT INTO example(component, description, properties) VALUES
Expand Down
3 changes: 2 additions & 1 deletion sqlpage/templates/shell.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<li class="nav-item{{#if this.submenu}} dropdown{{/if}}">
<a class="nav-link {{#if this.submenu}}dropdown-toggle{{/if}}" href="{{#if this.link}}{{this.link}}{{else}}#{{/if}}"
{{~#if this.submenu}} data-bs-toggle="dropdown" data-bs-auto-close="outside" {{/if~}}
{{#if this.target}}target="{{this.target}}"{{/if}}
role="button"
>
{{~#if this.image~}}
Expand All @@ -114,7 +115,7 @@
<div class="dropdown-menu dropdown-menu-end" data-bs-popper="static">
{{~#each this.submenu~}}
{{#if (or (or this.title this.icon) this.image)}}
<a class="dropdown-item" href="{{this.link}}">
<a class="dropdown-item" href="{{this.link}}" {{#if this.target}}target="{{this.target}}"{{/if}}>
{{~#if this.image~}}
<span {{~#if this.title}} class="me-1"{{/if}}>
{{~#if (eq ../this.size 'sm')}}
Expand Down