feat: set columns based on width

This commit is contained in:
Himanshu Warekar 2019-10-22 22:29:40 +05:30
parent e90185222c
commit 4189f36ba0

View file

@ -286,8 +286,19 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
}))
);
// limit to 10 columns
this.columns = this.columns.slice(0, 10);
// limit max to 8 columns
// Screen with low density no of columns 4
// Screen with medium density no of columns 6
// Screen with high density no of columns 8
let column_count = 6;
if (window.innerWidth <= 1200) {
column_count = 4;
} else if (window.innerWidth > 1440) {
column_count = 8;
}
this.columns = this.columns.slice(0, column_count);
}
get_no_result_message() {