Sha256: 69399961244c9b1c11f8a0149eeef4fceae8a73992029ffc3f6b462b46f78680

Contents?: true

Size: 639 Bytes

Versions: 9

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module Navigation
    module Editor
      class ItemComponent < BaseComponent
        include KpopHelper

        def edit_item_link
          if item.persisted?
            helpers.katalyst_navigation.edit_menu_item_path(menu, item)
          else
            helpers.katalyst_navigation.new_menu_item_path(item.menu, type: item.type)
          end
        end

        private

        def default_html_attributes
          {
            id:   dom_id(item),
            data: {
              controller: ITEM_CONTROLLER,
            },
          }
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katalyst-navigation-1.8.4 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.8.3 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.8.2 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.8.1 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.8.0 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.6.0 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.5.2 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.5.1 app/components/katalyst/navigation/editor/item_component.rb
katalyst-navigation-1.5.0 app/components/katalyst/navigation/editor/item_component.rb