Skip to content

Commit 11ee8e5

Browse files
committed
exclude default sort dimensions in pivot
1 parent acc676f commit 11ee8e5

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

dist/widgets.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "widgets",
3-
"version": "1.2.7",
3+
"version": "1.2.8",
44
"description": "",
55
"main": "dist/widgets.js",
66
"directories": {

src/lib/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ function generatedData(it){
8484
sheet[get_option_path] = {};
8585
path = get_option_path;
8686
titles.push(option.title);
87-
sort.push(option.sort != undefined ? option.sort : 'asc');
87+
// sort.push(option.sort != undefined ? option.sort : 'asc');
88+
sort.push(option.sort);
8889
if (option.include){
8990
sheet[get_option_path] = getSheet(item, option.include).sheet;
9091
path = path + '.' + getSheet(item, option.include).path;
@@ -139,15 +140,15 @@ function generatedData(it){
139140
// console.log(titles);
140141

141142
let sort = function(arr, direction = 'asc', c = undefined){
142-
if (direction != 'desc') {
143+
if (direction == 'asc') {
143144
arr.sort(function(a,b){
144145
let aa = c == undefined ? a : a[c];
145146
let bb = c == undefined ? b : b[c];
146147
if (aa<bb) return -1;
147148
if (aa>bb) return 1;
148149
return 0;
149150
});
150-
} else {
151+
} else if (direction == 'desc') {
151152
arr.sort(function(a,b){
152153
let aa = c == undefined ? a : a[c];
153154
let bb = c == undefined ? b : b[c];

0 commit comments

Comments
 (0)