mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
[sort libs] fix for broken libraries
This commit is contained in:
@@ -836,14 +836,26 @@ define([
|
||||
var libs = options.libs;
|
||||
|
||||
switch(sort_mode) {
|
||||
case 'name_up':
|
||||
case 'name_up': // name of a broken library is null
|
||||
libs.comparator = function(a, b) {
|
||||
if (!a.get('name')) {
|
||||
return 1;
|
||||
}
|
||||
if (!b.get('name')) {
|
||||
return -1;
|
||||
}
|
||||
var result = _this.compareTwoWord(a.get('name'), b.get('name'));
|
||||
return result;
|
||||
};
|
||||
break;
|
||||
case 'name_down':
|
||||
libs.comparator = function(a, b) {
|
||||
if (!a.get('name')) {
|
||||
return -1;
|
||||
}
|
||||
if (!b.get('name')) {
|
||||
return 1;
|
||||
}
|
||||
var result = _this.compareTwoWord(a.get('name'), b.get('name'));
|
||||
return -result;
|
||||
};
|
||||
|
Reference in New Issue
Block a user