Commit 86ba08a0 by Dányi Bence

one: sort files by size

parent 664f1793
......@@ -200,7 +200,16 @@ $(function() {
return 1;
}
return -1;
}
},
size: function(a, b) {
if(a.type === b.type) {
return b.originalSize-a.originalSize;
}
if(a.type === 'fájl') {
return 1;
}
return -1;
},
}[self.sortBy()]);
}
......@@ -258,6 +267,7 @@ $(function() {
if(d.TYPE === 'D') {
viewData = {
originalName: d.NAME,
originalSize: 0,
name: d.NAME.length > 30 ? (d.NAME.substr(0, 27) + '...') : d.NAME,
size: 'katalógus',
type: 'katalógus',
......@@ -288,6 +298,7 @@ $(function() {
}
viewData = {
originalName: d.NAME,
originalSize: d.SIZE,
name: d.NAME.length > 30 ? (d.NAME.substr(0, 27) + '...') : d.NAME,
size: convert(d.SIZE),
type: 'fájl',
......
......@@ -13,6 +13,7 @@
<select data-bind="value: sortBy">
<option value="name">Név szerint</option>
<option value="date">Dátum szerint</option>
<option value="size">Méret szerint</option>
</select>
</div>
<div class="name"><small>Jelenlegi hely: <span data-bind="text: currentPath"></span></small></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment