From 9734a4db807017d994d2ce33af452cecf60de531 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 26 Jul 2017 15:37:16 +0200 Subject: [PATCH] append new items to the top of the todo --- www/todo/main.js | 7 ++++++- www/todo/todo.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/www/todo/main.js b/www/todo/main.js index 2abe7b4aa..3571888a7 100644 --- a/www/todo/main.js +++ b/www/todo/main.js @@ -77,7 +77,12 @@ define([ var addTaskUI = function (el, animate) { var $taskDiv = $('
', { 'class': 'cp-task' - }).appendTo($list); + }); + if (animate) { + $taskDiv.prependTo($list); + } else { + $taskDiv.appendTo($list); + } $taskDiv.data('id', el); makeCheckbox(el, function (/*state*/) { diff --git a/www/todo/todo.js b/www/todo/todo.js index a8d864eb9..8a1a92635 100644 --- a/www/todo/todo.js +++ b/www/todo/todo.js @@ -47,7 +47,7 @@ define([ if (!Array.isArray(proxy.order)) { throw new Error('expected an array'); } - proxy.order.push(id); + proxy.order.unshift(id); proxy.data[id] = obj; };