-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2611 from sascha-karnatz/update_javascript/menubar
- Loading branch information
Showing
8 changed files
with
49 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Menubar extends HTMLElement { | ||
constructor() { | ||
super() | ||
const template = this.querySelector("template") | ||
const attachedShadowRoot = this.attachShadow({ mode: "open" }) | ||
attachedShadowRoot.appendChild(template.content.cloneNode(true)) | ||
} | ||
} | ||
|
||
customElements.define("alchemy-menubar", Menubar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
<% if !@preview_mode && @page && can?(:edit_content, @page) %> | ||
<div id="alchemy_menubar" style="display: none" data-turbo="false"> | ||
<ul> | ||
<li><%= link_to Alchemy.t(:to_alchemy), alchemy.admin_dashboard_url %></li> | ||
<li><%= link_to Alchemy.t(:edit_page), alchemy.edit_admin_page_url(@page) %></li> | ||
<li> | ||
<%= form_tag Alchemy.logout_path, method: Alchemy.logout_method do %> | ||
<%= button_tag Alchemy.t(:logout) %> | ||
<% end %> | ||
</li> | ||
</ul> | ||
</div> | ||
<alchemy-menubar> | ||
<template> | ||
<%= stylesheet_link_tag("alchemy/menubar") %> | ||
<div id="alchemy_menubar" data-turbo="false"> | ||
<ul> | ||
<li><%= link_to Alchemy.t(:to_alchemy), alchemy.admin_dashboard_url %></li> | ||
<li><%= link_to Alchemy.t(:edit_page), alchemy.edit_admin_page_url(@page) %></li> | ||
<li> | ||
<%= form_tag Alchemy.logout_path, method: Alchemy.logout_method do %> | ||
<%= button_tag Alchemy.t(:logout) %> | ||
<% end %> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
</alchemy-menubar> | ||
|
||
<%= stylesheet_link_tag("alchemy/menubar") %> | ||
<%= javascript_include_tag('alchemy/menubar') %> | ||
<%= javascript_include_tag('menubar', type: "module") %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters