From a299be7ff7112ac1821110703c65c77f69ff4dd2 Mon Sep 17 00:00:00 2001 From: Ashley Teoh Date: Sun, 15 Apr 2018 15:02:51 -0400 Subject: [PATCH] fix sorting function foreal --- notebook/static/tree/js/notebooklist.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/notebook/static/tree/js/notebooklist.js b/notebook/static/tree/js/notebooklist.js index 860632785..fb8104ec3 100644 --- a/notebook/static/tree/js/notebooklist.js +++ b/notebook/static/tree/js/notebooklist.js @@ -71,12 +71,14 @@ define([ } if (b.size === undefined) { - return (ascending) ? 1 : -1; + return (ascending) ? -1 : 1; } if (a.size > b.size) { return (ascending) ? 1 : -1; - } else { + } + + if (b.size > a.size) { return (ascending) ? -1 : 1; } @@ -864,7 +866,7 @@ define([ // Add in the date that the file was last modified item.find(".item_modified").text(utils.format_datetime(model.last_modified)); item.find(".item_modified").attr("title", moment(model.last_modified).format("YYYY-MM-DD HH:mm")); - item.find(".file_size").text(model.size || ''); + item.find(".file_size").html(model.size || " "); };