Module: MotionPrime::CellSectionMixin
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
Instance Method Summary
collapse
#container_view, #load_container_with_elements
Instance Attribute Details
#pending_display ⇒ Object
Returns the value of attribute pending_display.
9
10
11
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 9
def pending_display
@pending_display
end
|
#table ⇒ Object
16
17
18
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 16
def table
@table ||= options[:table].try(:weak_ref)
end
|
Instance Method Details
#cell_section_name ⇒ Object
30
31
32
33
34
35
36
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 30
def cell_section_name
self.class.custom_cell_section_name || begin
return name unless table
table_name = table.name.gsub('_table', '')
name.gsub("#{table_name}_", '')
end
end
|
#cell_type ⇒ Object
24
25
26
27
28
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 24
def cell_type
@cell_type ||= begin
self.is_a?(BaseFieldSection) ? :field : :cell
end
end
|
#container_bounds ⇒ Object
38
39
40
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 38
def container_bounds
@container_bounds ||= CGRectMake(0, 0, table.table_view.bounds.size.width, container_height)
end
|
#dealloc ⇒ Object
64
65
66
67
68
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 64
def dealloc
container_view.section = nil if container_view.respond_to?(:setSection)
super
end
|
#display ⇒ Object
59
60
61
62
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 59
def display
@pending_display = false
container_view.setNeedsDisplay
end
|
#init_container_element(options = {}) ⇒ Object
47
48
49
50
51
52
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 47
def init_container_element(options = {})
options[:styles] ||= []
options[:styles] = [:"#{table.name}_first_cell"] if table.data.first == self
options[:styles] = [:"#{table.name}_last_cell"] if table.data.last == self
super(options)
end
|
#pending_display! ⇒ Object
54
55
56
57
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 54
def pending_display!
@pending_display = true
display unless table.decelerating
end
|
#render_container(options = {}, &block) ⇒ Object
should do nothing, because table section will care about it.
43
44
45
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 43
def render_container(options = {}, &block)
block.call
end
|
#section_styles ⇒ Object
20
21
22
|
# File 'motion-prime/sections/_cell_section_mixin.rb', line 20
def section_styles
@section_styles ||= table.try(:cell_section_styles, self) || {}
end
|