Sha256: e7a5cb191a379372676b059a2b9cc78d785422e6f4ec1bd0878dda67cbbd752f

Contents?: true

Size: 622 Bytes

Versions: 10

Compression:

Stored size: 622 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module DecidimAwesome
    module MenuItemPresenterOverride
      extend ActiveSupport::Concern

      included do
        def link_to(name = nil, options = nil, html_options = nil, &block)
          html_options ||= {}
          html_options[:target] = @menu_item.try(:target)

          options ||= html_options
          @view.link_to(name, options, html_options, &block)
        end

        def active
          return @menu_item.active.call(url, @view) if @menu_item.try(:active).respond_to?(:call)

          @menu_item&.active
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.3 app/presenters/concerns/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.10.2 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.10.1 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.10.0 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.9.3 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.9.1 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.8.3 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.8.2 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.8.1 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb
decidim-decidim_awesome-0.8.0 app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb