Commit 6be5b093 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Page now centers on indicator when loaded

parent 8e725094
......@@ -5,7 +5,7 @@
#FETCH_URL = 'http://www.tvgids.nl/json/lists/programs.php'
FETCH_URL = 'programs.php'
HOUR_WIDTH = 200
SCROLL_MULTIPLIER = HOUR_WIDTH
#SCROLL_MULTIPLIER = HOUR_WIDTH
#
# Utils
......@@ -47,7 +47,6 @@ ChannelList = Backbone.Collection.extend(
initialize: (models, options) ->
#_.each(CHANNELS, (props, id) => @add(_.extend({id: id}, props)))
@fetchVisible()
#@fetchPrograms(0)
......@@ -155,6 +154,7 @@ AppView = Backbone.View.extend(
initialize: ->
@updateIndicator()
@centerIndicator()
@listenTo(Channels, 'reset', @addChannels)
Channels.fetch()
......@@ -180,6 +180,9 @@ AppView = Backbone.View.extend(
updateIndicator: ->
@$('.indicator').css('left', time2px(seconds_today(Date.now())) + 'px')
centerIndicator: ->
@el.scrollLeft = @$('.indicator').position().left - @$el.width() / 2
fetchPrograms: ->
Channels.fetchPrograms(Settings.get('day'))
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment