From 279f8b5d735cf9b9e83e12b0b6653cac0ab729a7 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 17 Jun 2013 17:49:48 -0700 Subject: [PATCH] Better require --- UI/Routing.js | 8 ++++---- UI/Shared/Footer/Model.js | 4 +--- UI/Shared/Footer/View.js | 8 +++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/UI/Routing.js b/UI/Routing.js index ad82e03ff..954d7cad0 100644 --- a/UI/Routing.js +++ b/UI/Routing.js @@ -1,9 +1,9 @@ "use strict"; -require(['app', 'Controller', 'RouteBinder'], function (app, controller, routeBinder) { +require(['app', 'Controller', 'RouteBinder', 'Shared/Footer/View'], function (App, Controller, RouteBinder, FooterView) { NzbDrone.Router = Backbone.Marionette.AppRouter.extend({ - controller: controller, + controller: Controller, appRoutes : { '' : 'series', 'series' : 'series', @@ -27,8 +27,8 @@ require(['app', 'Controller', 'RouteBinder'], function (app, controller, routeBi NzbDrone.Router = new NzbDrone.Router(); Backbone.history.start({ pushState: true }); - routeBinder.bind(); - NzbDrone.footerRegion.show(new NzbDrone.Shared.Footer.View()); + RouteBinder.bind(); + NzbDrone.footerRegion.show(new FooterView()); }); }); diff --git a/UI/Shared/Footer/Model.js b/UI/Shared/Footer/Model.js index 8f2b2a056..da81af62a 100644 --- a/UI/Shared/Footer/Model.js +++ b/UI/Shared/Footer/Model.js @@ -1,7 +1,7 @@ "use strict"; define(['app'], function () { - NzbDrone.Shared.Footer.Model = Backbone.Model.extend({ + return Backbone.Model.extend({ defaults: { 'version' : '0.0.0.0', 'buildDate' : Date.create() @@ -15,6 +15,4 @@ define(['app'], function () { } } }); - - return NzbDrone.Shared.Footer.Model; }); diff --git a/UI/Shared/Footer/View.js b/UI/Shared/Footer/View.js index 3db52203b..34cfcd31f 100644 --- a/UI/Shared/Footer/View.js +++ b/UI/Shared/Footer/View.js @@ -1,16 +1,14 @@ "use strict"; define(['app', - 'Shared/Footer/Model'], function () { - NzbDrone.Shared.Footer.View = Backbone.Marionette.ItemView.extend({ + 'Shared/Footer/Model'], function (App, FooterModel) { + return Backbone.Marionette.ItemView.extend({ template: 'Shared/Footer/Template', initialize: function () { - this.model = new NzbDrone.Shared.Footer.Model(); + this.model = new FooterModel(); this.model.set('version', NzbDrone.Constants.Version); this.model.set('buildDate', NzbDrone.Constants.BuildDate); } }); - - return new NzbDrone.Shared.Footer.View(); });