Show More
@@ -162,7 +162,26 b' define([' | |||||
162 | * directories. |
|
162 | * directories. | |
163 | * @param {String} error_msg An error message |
|
163 | * @param {String} error_msg An error message | |
164 | */ |
|
164 | */ | |
|
165 | ||||
|
166 | ||||
|
167 | var type_order = {'directory':0,'notebook':1,'file':2}; | |||
|
168 | ||||
165 | NotebookList.prototype.draw_notebook_list = function (list, error_msg) { |
|
169 | NotebookList.prototype.draw_notebook_list = function (list, error_msg) { | |
|
170 | list.content.sort(function(a, b) { | |||
|
171 | if (type_order[a['type']] < type_order[b['type']]) { | |||
|
172 | return -1; | |||
|
173 | } | |||
|
174 | if (type_order[a['type']] > type_order[b['type']]) { | |||
|
175 | return 1; | |||
|
176 | } | |||
|
177 | if (a['name'] < b['name']) { | |||
|
178 | return -1; | |||
|
179 | } | |||
|
180 | if (a['name'] > b['name']) { | |||
|
181 | return 1; | |||
|
182 | } | |||
|
183 | return 0; | |||
|
184 | }); | |||
166 | var message = error_msg || 'Notebook list empty.'; |
|
185 | var message = error_msg || 'Notebook list empty.'; | |
167 | var item = null; |
|
186 | var item = null; | |
168 | var model = null; |
|
187 | var model = null; |
General Comments 0
You need to be logged in to leave comments.
Login now