Commit 18d4f472 authored by dsumac's avatar dsumac Committed by Sindre Sorhus

Close #1044 PR: MarionetteJS - Use ui hash in all views

parent 7acd26fd
......@@ -42,11 +42,12 @@ TodoMVC.module('Layout', function (Layout, App, Backbone) {
completed: '.completed a',
active: '.active a',
all: '.all a',
summary: '#todo-count'
summary: '#todo-count',
clear: '#clear-completed'
},
events: {
'click #clear-completed': 'onClearClick'
'click @ui.clear': 'onClearClick'
},
collectionEvents: {
......
......@@ -12,15 +12,18 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette, $)
template: '#template-todoItemView',
ui: {
edit: '.edit'
edit: '.edit',
destroy: '.destroy',
label: 'label',
toggle: '.toggle'
},
events: {
'click .destroy': 'deleteModel',
'dblclick label': 'onEditClick',
'click @ui.destroy': 'deleteModel',
'dblclick @ui.label': 'onEditClick',
'keydown @ui.edit': 'onEditKeypress',
'focusout @ui.edit': 'onEditFocusout',
'click .toggle': 'toggle'
'click @ui.toggle': 'toggle'
},
modelEvents: {
......@@ -91,7 +94,7 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette, $)
},
events: {
'click #toggle-all': 'onToggleAllClick'
'click @ui.toggle': 'onToggleAllClick'
},
collectionEvents: {
......
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