Commit 1ce0515e authored by Taddeus Kroes's avatar Taddeus Kroes

Details window now has a scrollbar when browser window is small

parent 362f4218
...@@ -9,6 +9,7 @@ STORAGE_PROGRAMS = 'tvgids-programs' ...@@ -9,6 +9,7 @@ STORAGE_PROGRAMS = 'tvgids-programs'
HOURS_BEFORE = HOURS_AFTER = 2 HOURS_BEFORE = HOURS_AFTER = 2
DEFAULT_CHANNELS = [1, 2, 3, 4, 31, 46, 92, 36, 37, 34, 29, 18, 91] DEFAULT_CHANNELS = [1, 2, 3, 4, 31, 46, 92, 36, 37, 34, 29, 18, 91]
DEFAULT_CHANNELS = _.map(DEFAULT_CHANNELS, String) DEFAULT_CHANNELS = _.map(DEFAULT_CHANNELS, String)
DETAILS_WINDOW_PADDING = 22 # top/margin padding + border clean margin
# #
# Utils # Utils
...@@ -208,6 +209,8 @@ ProgramDetailsView = Backbone.View.extend( ...@@ -208,6 +209,8 @@ ProgramDetailsView = Backbone.View.extend(
initialize: (options) -> initialize: (options) ->
@listenTo(Settings, 'change:selected_program', @toggleDetails) @listenTo(Settings, 'change:selected_program', @toggleDetails)
@setBounds()
$(window).resize(=> @setBounds())
toggleDetails: -> toggleDetails: ->
id = Settings.get('selected_program') id = Settings.get('selected_program')
...@@ -230,9 +233,14 @@ ProgramDetailsView = Backbone.View.extend( ...@@ -230,9 +233,14 @@ ProgramDetailsView = Backbone.View.extend(
@$el.hide() @$el.hide()
@$('.content').empty() @$('.content').empty()
setBounds: ->
max = $(window).height() - 2 * DETAILS_WINDOW_PADDING
@$('.content').css(maxHeight: max)
@alignMiddle()
alignMiddle: -> alignMiddle: ->
top = @$('.content').outerHeight() / 2 height = @$('.content').outerHeight()
@$('.content').css(marginTop: "-#{top}px") @$('.content').css(marginTop: "-#{height / 2}px")
) )
AppView = Backbone.View.extend( AppView = Backbone.View.extend(
......
...@@ -110,8 +110,8 @@ function getwday($day) { ...@@ -110,8 +110,8 @@ function getwday($day) {
<% }) %> <% }) %>
</ul> </ul>
<div class="description"><%= description %></div> <div class="description"><%= description %></div>
Zie ook de <a href="http://www.tvgids.nl/programma/<%= id %>" <p>Zie ook de <a href="http://www.tvgids.nl/programma/<%= id %>"
target="_blank">details</a> op tvgids.nl. target="_blank">details</a> op tvgids.nl.</p>
</script> </script>
<script src="lib/jquery-1.10.2.min.js" type="text/javascript"></script> <script src="lib/jquery-1.10.2.min.js" type="text/javascript"></script>
......
...@@ -263,9 +263,11 @@ $details-initial-offset: 150px ...@@ -263,9 +263,11 @@ $details-initial-offset: 150px
width: $details-width width: $details-width
margin: -$details-initial-offset 0 0 (-$details-width / 2) margin: -$details-initial-offset 0 0 (-$details-width / 2)
border-radius: 6px border-radius: 6px
padding: 10px 15px padding: 12px 15px 0
font: 12px/18px Helvetica font: 12px/18px Helvetica
box-shadow: 0 0 7px 5px #0f0f0f box-shadow: 0 0 7px 5px #0f0f0f
overflow-x: hidden
overflow-y: auto
* *
max-width: $details-width max-width: $details-width
......
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