Class: Installation::Widgets::HidingPlace
- Inherits:
-
CWM::ReplacePoint
- Object
- CWM::ReplacePoint
- Installation::Widgets::HidingPlace
- Defined in:
- src/lib/installation/widgets/hiding_place.rb
Overview
This class offers a placeholder that to hide/show a given widget
Instance Method Summary collapse
-
#hide ⇒ Object
Hide the main widget.
-
#initialize(main_widget) ⇒ HidingPlace
constructor
Constructor.
-
#show ⇒ Object
Show the main widget.
-
#store ⇒ Object
Save the main widget value.
Constructor Details
#initialize(main_widget) ⇒ HidingPlace
Constructor
31 32 33 34 35 |
# File 'src/lib/installation/widgets/hiding_place.rb', line 31 def initialize() @main_widget = @empty = CWM::Empty.new("no_#{.}_placeholder") super(id: "#{.}_placeholder", widget: @empty) end |
Instance Method Details
#hide ⇒ Object
Hide the main widget
44 45 46 47 |
# File 'src/lib/installation/widgets/hiding_place.rb', line 44 def hide @main_widget_value = .value replace(empty) end |
#show ⇒ Object
Show the main widget
38 39 40 41 |
# File 'src/lib/installation/widgets/hiding_place.rb', line 38 def show replace() .value = @main_widget_value if @main_widget_value end |
#store ⇒ Object
Save the main widget value
50 51 52 53 |
# File 'src/lib/installation/widgets/hiding_place.rb', line 50 def store @main_widget_value = .value super end |