Class: OMF::Web::Theme::StackedRendererHelper
- Inherits:
-
Erector::Widget
- Object
- Erector::Widget
- OMF::Web::Theme::StackedRendererHelper
- Defined in:
- lib/omf-web/theme/bright/stacked_renderer.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(widgets, active_index, opts) ⇒ StackedRendererHelper
constructor
A new instance of StackedRendererHelper.
Constructor Details
#initialize(widgets, active_index, opts) ⇒ StackedRendererHelper
Returns a new instance of StackedRendererHelper.
40 41 42 43 44 |
# File 'lib/omf-web/theme/bright/stacked_renderer.rb', line 40 def initialize(, active_index, opts) super opts @widgets = @active_index = active_index end |
Instance Method Details
#content ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/omf-web/theme/bright/stacked_renderer.rb', line 46 def content() #widget @active_widget = @widgets prefix = "w#{self.object_id}" @widgets.each_with_index do |w, i| style = i == @active_index ? '' : 'display:none' div :id => "#{prefix}_#{i}", :class => prefix, :style => style do rawtext w.content.to_html end end end |