Class: HorizontalMenu

Inherits:
React::Component::Base
  • Object
show all
Defined in:
lib/bull/ui_core.rb

Overview

class Popover < React::Component::Base

param :show
param :close
param :id
param :target_id
include AbstractPopover

def content
  div do
    b{'hello'}
    div{' there'}
  end
end

end

Popover(id:‘popover’, target_id: ‘my_input’, show: state.show_popup, close: lambda‘hidden’) #where show_popup can be ‘visible’ or ‘hidden’

Instance Method Summary collapse

Instance Method Details

#active(page) ⇒ Object



781
782
783
# File 'lib/bull/ui_core.rb', line 781

def active page
  params.page == page ? 'active': ''
end

#renderObject



785
786
787
788
789
790
791
792
793
794
795
# File 'lib/bull/ui_core.rb', line 785

def render
  div(class: 'no-print') do
    ul(class: 'menu') do
      params.options.each_pair do |k, v|
        li(class: 'menu-item ' + active(k)){a(href: '#'){v}.on(:click){params.set_page.call k}}
      end
      li{a(href: '#'){'en'}.on(:click){params.language.value = 'en'}}
      li{a(href: '#'){'es'}.on(:click){params.language.value = 'es'}}
    end if params.options.length > 1
  end
end