Add missing detail data to item pages

This commit is contained in:
Andrew Miner
2017-07-13 16:52:51 -04:00
parent dac1a8dceb
commit ab96166601
8 changed files with 63 additions and 42 deletions
@@ -5,30 +5,31 @@
# All rights reserved.
#
BaseController = require '../../base_controller'
BaseController = require "../../base_controller"
########################################################################################################################
module.exports = class VideoController extends BaseController
constructor: (options={})->
if not options.model? then throw new Error 'options.model is required'
options.templateName = 'common/video'
if not options.model? then throw new Error "options.model is required"
options.templateName = "common/video"
super options
# BaseController Overrides #####################################################################
onDidRender: ->
@$iframe = @$('iframe')
@$caption = @$('.caption p')
@$iframe = @$("iframe")
@$caption = @$(".caption p")
super
refresh: ->
@$caption.html @model.name
@$iframe.attr 'src', @_createYouTubeUrl()
@$iframe.attr "src", @_createYouTubeUrl()
super
# Private ######################################################################################
_createYouTubeUrl: ->
return "http://www.youtube.com/embed/#{@model.youTubeId}?modestbranding=1&autohide=1&showinfo=0"