Class: GuindillaGUI::Box
- Defined in:
- lib/guindilla_gui/guindilla_classes.rb
Overview
—————————————————————————-#
Box #
—————————————————————————-#
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
Attributes inherited from Element
Attributes inherited from Guindilla
#active_id, #blocks, #elements, #inputs, #socket
Instance Method Summary collapse
-
#initialize(direction, attributes, &block) ⇒ Box
constructor
A new instance of Box.
Methods inherited from Element
Methods inherited from Guindilla
#after, #alert, #align, #append, #attributes, #audio_out, #background, #border, #border_color, #border_radius, #border_width, #bullet_list, #button, #canvas, #chart, #checkbox, #circle, #color, #color_input, #container, #display, #every, #file_input, #font, #font_family, #font_size, #h_box, #h_rule, #heading, #height, #hide, #image, #justify, #line_break, #link, #margin, #move_to, #number_input, #on_click, #on_hover, #on_leave, #on_mouse_move, #opacity, #ordered_list, #padding, #para, #polygon, #radio_button, #range_slider, #rectangle, #rotate, #show, #size, #source, #square, #style, #sub_script, #sup_script, #text, #text_align, #text_input, #toggle, #transition, #triangle, #url_input, #v_box, #video_out, #web_frame, #width
Constructor Details
#initialize(direction, attributes, &block) ⇒ Box
Returns a new instance of Box.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/guindilla_gui/guindilla_classes.rb', line 221 def initialize(direction, attributes, &block) attributes[:justify_content] = attributes[:justify] if attributes[:justify] attributes[:align_items] = attributes[:align] if attributes [:align] super("div", attributes) unless direction == nil send_js(%Q~ #{self.id}.style.display = 'flex'; #{self.id}.style.flexFlow = '#{direction} wrap'; ~) end last_active_id = @@gui.active_id @@gui.active_id = self.id if block_given? block.call end @@gui.active_id = last_active_id # HACK: return self (?) # hmm, here?, in methods? nowhere? end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
219 220 221 |
# File 'lib/guindilla_gui/guindilla_classes.rb', line 219 def direction @direction end |