Better require

pull/2/head
Mark McDowall 12 years ago
parent 23859a1c55
commit 279f8b5d73

@ -1,9 +1,9 @@
"use strict"; "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({ NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
controller: controller, controller: Controller,
appRoutes : { appRoutes : {
'' : 'series', '' : 'series',
'series' : 'series', 'series' : 'series',
@ -27,8 +27,8 @@ require(['app', 'Controller', 'RouteBinder'], function (app, controller, routeBi
NzbDrone.Router = new NzbDrone.Router(); NzbDrone.Router = new NzbDrone.Router();
Backbone.history.start({ pushState: true }); Backbone.history.start({ pushState: true });
routeBinder.bind(); RouteBinder.bind();
NzbDrone.footerRegion.show(new NzbDrone.Shared.Footer.View()); NzbDrone.footerRegion.show(new FooterView());
}); });
}); });

@ -1,7 +1,7 @@
"use strict"; "use strict";
define(['app'], function () { define(['app'], function () {
NzbDrone.Shared.Footer.Model = Backbone.Model.extend({ return Backbone.Model.extend({
defaults: { defaults: {
'version' : '0.0.0.0', 'version' : '0.0.0.0',
'buildDate' : Date.create() 'buildDate' : Date.create()
@ -15,6 +15,4 @@ define(['app'], function () {
} }
} }
}); });
return NzbDrone.Shared.Footer.Model;
}); });

@ -1,16 +1,14 @@
"use strict"; "use strict";
define(['app', define(['app',
'Shared/Footer/Model'], function () { 'Shared/Footer/Model'], function (App, FooterModel) {
NzbDrone.Shared.Footer.View = Backbone.Marionette.ItemView.extend({ return Backbone.Marionette.ItemView.extend({
template: 'Shared/Footer/Template', template: 'Shared/Footer/Template',
initialize: function () { initialize: function () {
this.model = new NzbDrone.Shared.Footer.Model(); this.model = new FooterModel();
this.model.set('version', NzbDrone.Constants.Version); this.model.set('version', NzbDrone.Constants.Version);
this.model.set('buildDate', NzbDrone.Constants.BuildDate); this.model.set('buildDate', NzbDrone.Constants.BuildDate);
} }
}); });
return new NzbDrone.Shared.Footer.View();
}); });

Loading…
Cancel
Save