fix(minor): ui fixes to grid scrolling, etc

This commit is contained in:
Rushabh Mehta 2021-01-14 15:38:47 +05:30
parent e88b5f6a85
commit 30ad27e075
5 changed files with 9 additions and 4 deletions

View file

@ -182,7 +182,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
let filter_string = me.get_filter_description(args.filters);
if (filter_string) {
r.results.push({
html: `<span class="text-muted">${filter_string}</span>`,
html: `<span class="text-muted" style="line-height: 1.5">${filter_string}</span>`,
value: '',
action: () => {}
});

View file

@ -201,7 +201,7 @@ export default class Grid {
this.wrapper.find('.grid-heading-row .grid-row-check:checked:first').prop('checked', 0);
if (selected_children.length == this.grid_pagination.page_length) {
frappe.utils.scroll_to(this.wrapper);
this.scroll_to_top();
}
}
@ -213,9 +213,12 @@ export default class Grid {
this.wrapper.find('.grid-heading-row .grid-row-check:checked:first').prop('checked', 0);
this.refresh();
frappe.utils.scroll_to(this.wrapper);
this.scroll_to_top();
});
}
scroll_to_top() {
frappe.utils.scroll_to(this.wrapper);
}
select_row(name) {

View file

@ -108,6 +108,7 @@ export default class GridPagination {
}
this.update_page_numbers();
this.grid.scroll_to_top();
}
go_to_last_page_to_add_row() {

View file

@ -281,7 +281,7 @@ Object.assign(frappe.utils, {
},
get_scroll_position: function(element, additional_offset) {
let header_offset = $(".navbar").height() + $(".page-head").height();
let header_offset = $(".navbar").height() + $(".page-head:visible").height();
let scroll_top = $(element).offset().top - header_offset - cint(additional_offset);
return scroll_top;
},

View file

@ -370,6 +370,7 @@
background-color: var(--fg-color);
.btn {
box-shadow: none;
margin-top: -3px;
}
}