Sha256: 959b135bd29552d3fa325f77e3d96ecbd81322a2f9567ebe336119bee98ed9eb

Contents?: true

Size: 677 Bytes

Versions: 36

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/require_sub'

module EacRailsUtils
  module MenusHelper
    ::EacRubyUtils.require_sub __FILE__

    def dropdown_menu(entries)
      entries = DataBuilder.new(self).build(entries)
      return nil unless entries

      id = SecureRandom.hex(5)
      GuiBuilder.new(self).build(entries, id: id, class: 'jMenu') <<
        javascript_tag("$(document).ready(function(){$('\##{id}').jMenu();});")
    end

    def bootstrap_dropdown_menu(entries, options = {})
      entries = DataBuilder.new(self).build(entries)
      return nil unless entries

      BootstrapGuiBuilder.new(self, options).build(entries)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
eac_rails_utils-0.23.1 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.23.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.22.3 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.22.2 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.22.1 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.22.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.21.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.20.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.19.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.18.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.17.2 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.17.1 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.17.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.16.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.15.2 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.15.1 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.15.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.14.1 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.14.0 app/helpers/eac_rails_utils/menus_helper.rb
eac_rails_utils-0.13.5 app/helpers/eac_rails_utils/menus_helper.rb