From 856080bf26794d264c2694f56e91c1dbb1c3a6d7 2014-12-12 14:56:26 From: Bussonnier Matthias Date: 2014-12-12 14:56:26 Subject: [PATCH] fix ordering dirs > notebook> files --- diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index fc66c95..eed8309 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -162,12 +162,16 @@ define([ * directories. * @param {String} error_msg An error message */ + + + var type_order = {'directory':0,'notebook':1,'file':2}; + NotebookList.prototype.draw_notebook_list = function (list, error_msg) { list.content.sort(function(a, b) { - if (a['type'] < b['type']) { + if (type_order[a['type']] < type_order[b['type']]) { return -1; } - if (a['type'] > b['type']) { + if (type_order[a['type']] > type_order[b['type']]) { return 1; } if (a['name'] < b['name']) {