Commit e40dcb03 authored by Sam Saccone's avatar Sam Saccone

Fix jscs warnings on Marionette

parent 6eb745d2
...@@ -39,8 +39,8 @@ TodoMVC.module('Layout', function (Layout, App, Backbone) { ...@@ -39,8 +39,8 @@ TodoMVC.module('Layout', function (Layout, App, Backbone) {
}, },
onInputKeypress: function (e) { onInputKeypress: function (e) {
var ENTER_KEY = 13, var ENTER_KEY = 13;
todoText = this.ui.input.val().trim(); var todoText = this.ui.input.val().trim();
if (e.which === ENTER_KEY && todoText) { if (e.which === ENTER_KEY && todoText) {
this.collection.create({ this.collection.create({
...@@ -72,7 +72,7 @@ TodoMVC.module('Layout', function (Layout, App, Backbone) { ...@@ -72,7 +72,7 @@ TodoMVC.module('Layout', function (Layout, App, Backbone) {
}, },
collectionEvents: { collectionEvents: {
'all': 'render' all: 'render'
}, },
templateHelpers: { templateHelpers: {
......
...@@ -27,7 +27,7 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) { ...@@ -27,7 +27,7 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
}, },
modelEvents: { modelEvents: {
'change': 'render' change: 'render'
}, },
onRender: function () { onRender: function () {
...@@ -65,7 +65,8 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) { ...@@ -65,7 +65,8 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
}, },
onEditKeypress: function (e) { onEditKeypress: function (e) {
var ENTER_KEY = 13, ESC_KEY = 27; var ENTER_KEY = 13;
var ESC_KEY = 27;
if (e.which === ENTER_KEY) { if (e.which === ENTER_KEY) {
this.onEditFocusout(); this.onEditFocusout();
...@@ -132,7 +133,7 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) { ...@@ -132,7 +133,7 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
var isChecked = e.currentTarget.checked; var isChecked = e.currentTarget.checked;
this.collection.each(function (todo) { this.collection.each(function (todo) {
todo.save({ 'completed': isChecked }); todo.save({ completed: isChecked });
}); });
} }
}); });
......
...@@ -17,10 +17,10 @@ TodoMVC.module('TodoList', function (TodoList, App, Backbone, Marionette) { ...@@ -17,10 +17,10 @@ TodoMVC.module('TodoList', function (TodoList, App, Backbone, Marionette) {
// //
// Control the workflow and logic that exists at the application // Control the workflow and logic that exists at the application
// level, above the implementation detail of views and models // level, above the implementation detail of views and models
TodoList.Controller = Marionette.Controller.extend({ TodoList.Controller = Marionette.Controller.extend({
initialize: function () { initialize: function () {
this.todoList = new App.Todos.TodoList(); this.todoList = new App.Todos.TodoList();
}, },
// Start the app by showing the appropriate views // Start the app by showing the appropriate views
// and fetching the list of todo items, if there are any // and fetching the list of todo items, if there are any
start: function () { start: function () {
......
...@@ -4,23 +4,23 @@ ...@@ -4,23 +4,23 @@
// TodoMVC is global for developing in the console // TodoMVC is global for developing in the console
// and functional testing. // and functional testing.
var App = Backbone.Marionette.Application.extend({ var App = Backbone.Marionette.Application.extend({
setRootLayout: function() { setRootLayout: function () {
this.root = new TodoMVC.Layout.Root(); this.root = new TodoMVC.Layout.Root();
} }
}); });
window.TodoMVC = new App(); window.TodoMVC = new App();
(function () { (function () {
var filterState = new Backbone.Model({ var filterState = new Backbone.Model({
filter: 'all' filter: 'all'
}); });
TodoMVC.reqres.setHandler('filterState', function () { TodoMVC.reqres.setHandler('filterState', function () {
return filterState; return filterState;
}); });
})(); })();
TodoMVC.on('before:start', function () { TodoMVC.on('before:start', function () {
TodoMVC.setRootLayout(); TodoMVC.setRootLayout();
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment