Pass all arguments from constructor to initialize in CoreViews, add lodash to default view context

This commit is contained in:
Scott Erickson 2015-10-12 16:46:30 -07:00
parent 2a739ea765
commit b38a6c5060
2 changed files with 3 additions and 2 deletions

View file

@ -51,7 +51,7 @@ module.exports = class CocoView extends Backbone.View
@listenTo(@supermodel, 'failed', @onResourceLoadFailed)
@warnConnectionError = _.throttle(@warnConnectionError, 3000)
super options
super arguments...
destroy: ->
@stopListening()
@ -130,6 +130,7 @@ module.exports = class CocoView extends Backbone.View
context.moment = moment
context.translate = $.i18n.t
context.view = @
context._ = _
context
afterRender: ->

View file

@ -22,7 +22,7 @@ module.exports = class ModalView extends CocoView
@className = @className.replace ' fade', '' if options.instant or @instant
@closeButton = options.closeButton if options.closeButton?
@modalWidthPercent = options.modalWidthPercent if options.modalWidthPercent
super options
super arguments...
getRenderData: (context={}) ->
context = super(context)