Class: BBMB::Html::View::FavoritesForm

Inherits:
HtmlGrid::DivForm
  • Object
show all
Includes:
UnavailableMethods
Defined in:
lib/bbmb/html/view/favorites.rb

Constant Summary collapse

COMPONENTS =
{
  [0,0] => FavoritesPositions,
  [0,1] => :unavailables,
}
EVENT =
:increment_order
FORM_NAME =
'favorites'

Instance Method Summary collapse

Methods included from UnavailableMethods

#unavailables

Instance Method Details

#initObject



97
98
99
100
101
102
# File 'lib/bbmb/html/view/favorites.rb', line 97

def init
  unless(@model.empty?)
    components.update( [1,1] => :submit, [2,1] => :nullify, [3,1] => :reset )
  end
  super
end

#nullify(model) ⇒ Object



103
104
105
106
107
# File 'lib/bbmb/html/view/favorites.rb', line 103

def nullify(model)
  button = HtmlGrid::Button.new(:nullify, model, @session, self)
  button.set_attribute('onClick', "zeroise(this.form);")
  button
end

#reset(model) ⇒ Object



108
109
110
111
112
# File 'lib/bbmb/html/view/favorites.rb', line 108

def reset(model)
  input = HtmlGrid::Button.new(:default_values, model, @session, self)
  input.set_attribute('type', 'reset')
  input
end