[API] Listen to add/remove buttons

This commit is contained in:
Victor Woeltjen 2016-06-17 13:41:59 -07:00
parent be0029e59a
commit e4a4704baa
2 changed files with 10 additions and 3 deletions

View File

@ -1,9 +1,9 @@
<div class="tool-bar btn-bar contents abs">
<a class="s-btn labeled">
<a class="s-btn labeled example-add">
<span class="ui-symbol icon">+</span>
<span class="title-label">Add Task</span>
</a>
<a class="s-btn">
<a class="s-btn example-remove">
<span class="ui-symbol icon">Z</span>
</a>
</div>

View File

@ -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 () {