mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-02-22 09:52:47 +01:00
sort file in fileview tag
This commit is contained in:
parent
f3f3559393
commit
5b6e6f8d94
Binary file not shown.
@ -265,6 +265,30 @@ namespace OS {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// sort file by type, then by name
|
||||||
|
data
|
||||||
|
.sort(function(a:API.FileInfoType,b:API.FileInfoType): number{
|
||||||
|
if(a.filename)
|
||||||
|
{
|
||||||
|
a.name = a.filename;
|
||||||
|
}
|
||||||
|
if(b.filename)
|
||||||
|
{
|
||||||
|
b.name = b.filename;
|
||||||
|
}
|
||||||
|
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
||||||
|
})
|
||||||
|
.sort(function(a:API.FileInfoType,b:API.FileInfoType): number{
|
||||||
|
if(!a.type)
|
||||||
|
{
|
||||||
|
a.type = "none";
|
||||||
|
}
|
||||||
|
if(!b.type)
|
||||||
|
{
|
||||||
|
b.type = "none";
|
||||||
|
}
|
||||||
|
return a.type.toLowerCase().localeCompare(b.type.toLowerCase());
|
||||||
|
});
|
||||||
this.data = data;
|
this.data = data;
|
||||||
if (this.status) {
|
if (this.status) {
|
||||||
(this.refs.status as LabelTag).text = " ";
|
(this.refs.status as LabelTag).text = " ";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user