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

Fix Sidebar Menu #16

Merged
merged 5 commits into from
Feb 19, 2025
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
5 changes: 5 additions & 0 deletions app/assets/plutonium.js
Original file line number Diff line number Diff line change
Expand Up @@ -24313,8 +24313,13 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
}
};

// src/js/controllers/sidebar_controller.js
var sidebar_controller_default = class extends Controller {
};

// src/js/controllers/register_controllers.js
function register_controllers_default(application2) {
application2.register("sidebar", sidebar_controller_default);
application2.register("resource-header", resource_header_controller_default);
application2.register("nested-resource-form-fields", nested_resource_form_fields_controller_default);
application2.register("form", form_controller_default);
Expand Down
6 changes: 3 additions & 3 deletions app/assets/plutonium.js.map

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions app/assets/plutonium.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions app/assets/plutonium.min.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/plutonium/ui/layout/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def view_template
class: "bg-white border-b border-gray-200 px-4 py-2.5 dark:bg-gray-800 dark:border-gray-700 fixed left-0 right-0 top-0 z-50",
data: {
controller: "resource-header",
header_sidebar_outlet: "#sidebar-navigation"
resource_header_sidebar_outlet: "#sidebar-navigation"
}
) do
div(class: "flex flex-wrap justify-between items-center") do
Expand All @@ -70,7 +70,7 @@ def render_brand_section
# @private
def render_sidebar_toggle
button(
data_action: "header#toggleDrawer",
data_action: "resource-header#toggleDrawer",
aria_controls: "#sidebar-navigation",
class: %(p-2 mr-2 text-gray-600 rounded-lg cursor-pointer lg:hidden hover:text-gray-900
hover:bg-gray-100 focus:bg-gray-100 dark:focus:bg-gray-700 focus:ring-2
Expand All @@ -97,11 +97,11 @@ def render_brand
# Renders the toggle icons for the sidebar button
# @private
def render_toggle_icons
span(data_header_target: "openIcon") do
span(data_resource_header_target: "openIcon") do
render Phlex::TablerIcons::Menu.new(class: "w-6 h-6")
end

span(data_header_target: "closeIcon", class: "hidden", aria_hidden: "true") do
span(data_resource_header_target: "closeIcon", class: "hidden", aria_hidden: "true") do
render Phlex::TablerIcons::X.new(class: "w-6 h-6")
end

Expand Down
3 changes: 2 additions & 1 deletion lib/plutonium/ui/layout/sidebar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def view_template(&)
# @private
def render_sidebar_container(&)
aside(
data: {controller: "sidebar"},
id: "sidebar-navigation",
aria: {label: "Sidebar Navigation"},
class: "fixed top-0 left-0 z-40 w-64 h-screen pt-14 transition-transform -translate-x-full lg:translate-x-0",
Expand All @@ -43,7 +44,7 @@ def render_content(&)

# @private
def render_color_mode_controls
div(class: "hidden absolute bottom-0 left-0 justify-center p-4 space-x-4 w-full lg:flex bg-white dark:bg-gray-800 z-20 border-r border-gray-200 dark:border-gray-700") do
div(class: "absolute bottom-0 left-0 justify-center p-4 space-x-4 w-full flex bg-white dark:bg-gray-800 z-20 border-r border-gray-200 dark:border-gray-700") do
render ColorModeSelector.new
end
end
Expand Down
2 changes: 2 additions & 0 deletions src/js/controllers/register_controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import ResourceTabListController from "./resource_tab_list_controller.js"
import AttachmentInputController from "./attachment_input_controller.js"
import AttachmentPreviewController from "./attachment_preview_controller.js"
import AttachmentPreviewContainerController from "./attachment_preview_container_controller.js"
import SidebarController from "./sidebar_controller.js"

export default function (application) {
// Register controllers here
application.register("sidebar", SidebarController)
application.register("resource-header", ResourceHeaderController)
application.register("nested-resource-form-fields", NestedResourceFormFieldsController)
application.register("form", FormController)
Expand Down
3 changes: 3 additions & 0 deletions src/js/controllers/sidebar_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Controller } from "@hotwired/stimulus";

export default class extends Controller {}
Loading