Commit 777a74ae authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #628 from Roland1975/gh-pages

Refine selector by providing a context
parents 5a2db4c0 c4fdbfcb
...@@ -43,13 +43,14 @@ jQuery(function ($) { ...@@ -43,13 +43,14 @@ jQuery(function ($) {
this.todoTemplate = Handlebars.compile($('#todo-template').html()); this.todoTemplate = Handlebars.compile($('#todo-template').html());
this.footerTemplate = Handlebars.compile($('#footer-template').html()); this.footerTemplate = Handlebars.compile($('#footer-template').html());
this.$todoApp = $('#todoapp'); this.$todoApp = $('#todoapp');
this.$newTodo = $('#new-todo'); this.$header = this.$todoApp.find('#header');
this.$toggleAll = $('#toggle-all'); this.$main = this.$todoApp.find('#main');
this.$main = $('#main');
this.$todoList = $('#todo-list');
this.$footer = this.$todoApp.find('#footer'); this.$footer = this.$todoApp.find('#footer');
this.$count = $('#todo-count'); this.$newTodo = this.$header.find('#new-todo');
this.$clearBtn = $('#clear-completed'); this.$toggleAll = this.$main.find('#toggle-all');
this.$todoList = this.$main.find('#todo-list');
this.$count = this.$footer.find('#todo-count');
this.$clearBtn = this.$footer.find('#clear-completed');
}, },
bindEvents: function () { bindEvents: function () {
var list = this.$todoList; var list = this.$todoList;
......
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