Commit f2a26dc0 authored by Addy Osmani's avatar Addy Osmani

fixing firefox issues related to new todo appending

parent 9ae927f9
......@@ -96,6 +96,7 @@ changes to code. At present, JavaScriptMVC is the only framework included which
<li><a href="todo-example/spine/index.html">Spine.js</a></li>
<li><a href="todo-example/sammyjs/index.html">Sammy.js</a></li>
<li><a href="todo-example/knockoutjs/index.html">KnockoutJS (MVVM)</a></li>
<li><a href="todo-example/sproutcore/index.html">SproutCore</a></li>
</ul> </section> <!-- /.widget -->
<section class="widget"> <h4 class="widgettitle">GitHub</h4> <ul> <li><a
......@@ -107,7 +108,11 @@ href="https://github.com/addyosmani/todomvc/">View repository</a></li> </ul>
href="http://twitter.com/addyosmani">Addy Osmani</a></li> <li><a
href="http://twitter.com/justinbmeyer">Justin Meyer</a></li> <li><a
href="http://twitter.com/jeromegn">Jérôme Gravel-Niquet</a></li> <li><a
href="http://twitter.com/macmann">Alex MacCaw</a></li> <li><a href="">Ashish Sharma</a></li> </ul>
href="http://twitter.com/macmann">Alex MacCaw</a></li>
<li><a href="">Ashish Sharma</a></li>
<li><a href="http://sproutcore.com">Tom Dale, Yehuda Katz</a></li>
</ul>
</section> <!-- /.widget -->
......
......@@ -46,24 +46,14 @@
var todoContent = $(this).val();
var todo = Todos.create({ name: todoContent, done: false, listId: parseInt($('h2').attr('data-id'), 10) });
context.partial('templates/_todo.template', todo, function(html) {
//$(html).insertAfter('#todo-list li:last');
var q = $(html);
console.log(q);
$('#todo-list').append(q);
$('#todo-list').append(html);
});
$(this).val('');
}
});
/*
$('#lists')
.delegate('dd[data-id]', 'click', function() {
context.redirect('#/list/'+$(this).attr('data-id'));
app.trigger('updateList');
});*/
$('.trashcan')
.live('click', function() {
......@@ -84,14 +74,7 @@
app.trigger('mark' + (isDone ? 'Done' : 'Undone'), { id: $li.attr('data-id') });
});
/*
$('.checkbox')
.live('click', function() {
var $this = $(this),
$li = $this.parents('li').toggleClass('done'),
isDone = $li.is('.done');
app.trigger('mark' + (isDone ? 'Done' : 'Undone'), { id: $li.attr('data-id') });
});*/
$('[contenteditable]')
.live('focus', function() {
......@@ -145,7 +128,6 @@
this.redirect(lastViewedOrFirstList);
}
//app.trigger('updateLists');
});
/*save the route as the lastviewed item*/
......@@ -156,9 +138,7 @@
this.bind('save', function(e, data) {
var model = data.type == 'todo' ? Todos : Lists;
model.update(data.id, { name: data.name });
//if (data.type == 'list') {
//app.trigger('updateLists');
// }
});
/*marking the selected item as done*/
......@@ -193,25 +173,12 @@
this.redirect('#/list/'+listId);
}
//app.trigger('updateLists');
} else {
// delete the todo from the view
$('li[data-id=' + data.id + ']').remove();
}
// }
});
/*
this.bind('updateLists', function(e, data) {
var selected = parseInt(location.hash.substr(location.hash.lastIndexOf('/')+1), 10);
this.partial('templates/_lists.template', {
lists: Lists.getAll(),
selected: selected
}, function(html) {
$('#lists').html(html);
});
});*/
});
......
<h2>What?!</h2>
<p>Try clicking on one of your lists to the right.</p>
\ No newline at end of file
There was an error.
\ No newline at end of file
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