From 3f9e11eb7c318ec4f0ffb1feb6f4381c837cae49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Sun, 22 Feb 2015 23:53:16 +0100 Subject: [PATCH] Fixed a bug that prevented a newly created list to be clickable --- js/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index c105c6b..388f4a3 100644 --- a/js/app.js +++ b/js/app.js @@ -87,10 +87,10 @@ function addItemToListClicked(list_ID, txt) { } function addNewListClicked(newListName) { - db.lists.add({name: newListName}).then(function(list) { - $('li#add_list_last_elem').before('
  • ' + newListName + '
  • '); - $('a#list_' + list.id).data('listID', list.id); - $('a#list_' + list.id).click(function () { openList($(this)); }); + db.lists.add({name: newListName}).then(function(listID) { + $('li#add_list_last_elem').before('
  • ' + newListName + '
  • '); + $('a#list_' + listID).data('listID', listID); + $('a#list_' + listID).click(function () { openList($(this)); }); $.afui.goBack(); }); }