From b38a6c5060bec391236bca2a1f1905fd8246d302 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 12 Oct 2015 16:46:30 -0700 Subject: [PATCH] Pass all arguments from constructor to initialize in CoreViews, add lodash to default view context --- app/views/core/CocoView.coffee | 3 ++- app/views/core/ModalView.coffee | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/core/CocoView.coffee b/app/views/core/CocoView.coffee index b313a9f46..f63cf6e5a 100644 --- a/app/views/core/CocoView.coffee +++ b/app/views/core/CocoView.coffee @@ -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: -> diff --git a/app/views/core/ModalView.coffee b/app/views/core/ModalView.coffee index 0a5b8afc3..801563fa5 100644 --- a/app/views/core/ModalView.coffee +++ b/app/views/core/ModalView.coffee @@ -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)