Skip to content

Instantly share code, notes, and snippets.

@igkuz
Created May 21, 2013 07:46
Show Gist options
  • Save igkuz/5618154 to your computer and use it in GitHub Desktop.
Save igkuz/5618154 to your computer and use it in GitHub Desktop.
def choose_category
@categories_menu.truncate
@channel_cat_rb_corner.props.top += @categories_menu.layout.dynamic_height
@channel_cat_lb_corner.props.top += @categories_menu.layout.dynamic_height
@categories = []
@category_list.each_with_index do |category, idx|
if idx == @current_category && category.children.count > 0
@categories << @categories_menu.view(Telemarker::Views::Panel::Channels::CategoryItem, category: category, expanded: true, categories_menu_height: @categories_menu_height) if category.channels_count
@categories[@categories.count - 1].activate_current_channel
focus_on @categories[@categories.count - 1]
@channel_cat_lb_corner.props.top += @categories[@current_category].channels_frame_height
@channel_cat_rb_corner.props.top += @categories[@current_category].channels_frame_height
else
@categories << @categories_menu.view(Telemarker::Views::Panel::Channels::CategoryItem, category: category, expanded: false)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment