Skip to content

Instantly share code, notes, and snippets.

@igkuz
Last active December 17, 2015 13:29
Show Gist options
  • Save igkuz/5618019 to your computer and use it in GitHub Desktop.
Save igkuz/5618019 to your computer and use it in GitHub Desktop.
def category_channels_unfocus(params)
if params[:side]== :down
@current_category += 1 if @current_category < @categories.count - 1
if @categories[@current_category].expanded
@categories[@current_category].activate_current_channel
focus_on @categories[@current_category]
else
@categories[@current_category].activate
app.statechart.send_action(:fill_channels, @category_list[@current_category])
focus_on self
end
elsif params[:side]== :up
@current_category -= 1 if @current_category > 0
if @categories[@current_category].expanded
@categories[@current_category].activate_current_channel
focus_on @categories[@current_category]
else
@categories[@current_category].activate
app.statechart.send_action(:fill_channels, @category_list[@current_category])
focus_on self
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment