Module: MotionPrime::SectionWithContainerMixin
- Extended by:
- MotionSupport::Concern
- Included in:
- DrawSectionMixin
- Defined in:
- motion-prime/sections/_section_with_container_mixin.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #container_view ⇒ Object
- #init_container_element(options = {}) ⇒ Object
- #load_container_with_elements(options = {}) ⇒ Object
Instance Method Details
#container_view ⇒ Object
9 10 11 |
# File 'motion-prime/sections/_section_with_container_mixin.rb', line 9 def container_view container_element.try(:view) end |
#init_container_element(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'motion-prime/sections/_section_with_container_mixin.rb', line 13 def init_container_element( = {}) @container_element ||= begin .merge!({ screen: screen, section: self.weak_ref, has_drawn_content: true }) = self.class..clone = ( || {}).deep_merge() type = .delete(:type) MotionPrime::BaseElement.factory(type, ) end end |
#load_container_with_elements(options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'motion-prime/sections/_section_with_container_mixin.rb', line 27 def load_container_with_elements( = {}) init_container_element([:container] || {}) # FIXME: does not work for grid sections @container_element. unless @container_element. ([:elements] || {}) if respond_to?(:prerender_elements_for_state) && prerender_enabled? prerender_elements_for_state(:normal) end end |