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