Compare commits

..

2 Commits

Author SHA1 Message Date
Alex Ling
c9b8770b9f Bump version to v0.2.5 2020-04-02 09:12:35 +00:00
Alex Ling
e568ec8878 Fix the unexpected sorting behavior on Chrome 2020-04-02 09:06:16 +00:00
3 changed files with 7 additions and 8 deletions

View File

@@ -50,10 +50,10 @@ $(() => {
sortedKeys.sort((a, b) => {
// sort by frequency of the key first
if (keyRange[a][2] !== keyRange[b][2]) {
return keyRange[a][2] < keyRange[b][2];
return (keyRange[a][2] < keyRange[b][2]) ? 1 : -1;
}
// then sort by range of the key
return (keyRange[a][1] - keyRange[a][0]) < (keyRange[b][1] - keyRange[b][0]);
return ((keyRange[a][1] - keyRange[a][0]) < (keyRange[b][1] - keyRange[b][0])) ? 1 : -1;
});
console.log(sortedKeys);
@@ -70,7 +70,7 @@ $(() => {
return -1;
if (a.numbers[key] === b.numbers[key])
continue;
return a.numbers[key] > b.numbers[key];
return (a.numbers[key] > b.numbers[key]) ? 1 : -1;
}
return 0;
});
@@ -102,12 +102,11 @@ $(() => {
res = ap > bp;
}
if (dir === 'up')
return res;
return res ? 1 : -1;
else
return !res;
return !res ? 1 : -1;
});
}
var html = '';
$('#item-container').append(items);
};

View File

@@ -1,5 +1,5 @@
name: mango
version: 0.2.4
version: 0.2.5
authors:
- Alex Ling <hkalexling@gmail.com>

View File

@@ -3,7 +3,7 @@ require "./context"
require "./mangadex/*"
require "option_parser"
VERSION = "0.2.4"
VERSION = "0.2.5"
config_path = nil