lib/ProMotion/screens/_tables/_table.rb in ProMotion-0.7.5 vs lib/ProMotion/screens/_tables/_table.rb in ProMotion-0.7.6
- old
+ new
@@ -67,12 +67,14 @@
PM.logger.info "Action not implemented: #{action.to_s}"
end
end
def accessory_toggled_switch(switch)
- table_cell = switch.superview
- index_path = table_cell.superview.indexPathForCell(table_cell)
+ # table_cell = switch.superview
+ table_cell = closest_parent(UITableViewCell, switch)
+ # index_path = table_cell.superview.indexPathForCell(table_cell)
+ index_path = closest_parent(UITableView, table_cell).indexPathForCell(table_cell)
data_cell = cell_at_section_and_index(index_path.section, index_path.row)
data_cell[:accessory][:arguments] = {} unless data_cell[:accessory][:arguments]
data_cell[:accessory][:arguments][:value] = switch.isOn if data_cell[:accessory][:arguments].is_a? Hash
@@ -104,10 +106,14 @@
return section_at_index(section)[:title] if section_at_index(section) && section_at_index(section)[:title]
end
# Set table_data_index if you want the right hand index column (jumplist)
def sectionIndexTitlesForTableView(table_view)
- self.table_data_index if self.respond_to?(:table_data_index)
+ if @promotion_table_data.filtered
+ nil
+ else
+ self.table_data_index if self.respond_to?(:table_data_index)
+ end
end
def tableView(table_view, cellForRowAtIndexPath:index_path)
@promotion_table_data.table_view_cell(index_path: index_path)
end