From e4a4704baabd5014a218056dea479f6d48de8117 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 17 Jun 2016 13:41:59 -0700 Subject: [PATCH] [API] Listen to add/remove buttons --- tutorials/todo/todo-toolbar.html | 4 ++-- tutorials/todo/todo.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tutorials/todo/todo-toolbar.html b/tutorials/todo/todo-toolbar.html index b955ceaee2..d2b2633e62 100644 --- a/tutorials/todo/todo-toolbar.html +++ b/tutorials/todo/todo-toolbar.html @@ -1,9 +1,9 @@
- + + Add Task - + Z
diff --git a/tutorials/todo/todo.js b/tutorials/todo/todo.js index cec200b43b..4c11088cfb 100644 --- a/tutorials/todo/todo.js +++ b/tutorials/todo/todo.js @@ -108,7 +108,14 @@ define([ } TodoToolbarView.prototype.show = function (container) { - $(container).append($(toolbarTemplate)); + var $els = $(toolbarTemplate); + var $add = $els.find('a.example-add'); + var $remove = $els.find('a.example-remove'); + + $(container).append($els); + + $add.on('click', window.alert.bind(window, "Add!")); + $remove.on('click', window.alert.bind(window, "Remove!")); }; TodoToolbarView.prototype.destroy = function () {