mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Merge pull request #8131 from minrk/sort-help
handle undefined when sorting quick help
This commit is contained in:
commit
25415547fb
@ -244,13 +244,13 @@ define([
|
||||
}
|
||||
}
|
||||
help.sort(function (a, b) {
|
||||
if (a.help_index > b.help_index){
|
||||
if (a.help_index === b.help_index) {
|
||||
return 0;
|
||||
}
|
||||
if (a.help_index === undefined || a.help_index > b.help_index){
|
||||
return 1;
|
||||
}
|
||||
if (a.help_index < b.help_index){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
});
|
||||
return help;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user