Merge branch 'rebrand-ui' of https://github.com/frappe/frappe into rebrand-ui

This commit is contained in:
Suraj Shetty 2020-12-15 13:33:02 +05:30
commit c4e47055a1
2 changed files with 9 additions and 4 deletions

View file

@ -1098,13 +1098,16 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
if (
$target.hasClass("filterable") ||
$target.hasClass("icon-heart") ||
$target.is(":checkbox") ||
$target.is("a")
$target.is(":checkbox")
) {
e.stopPropagation();
return;
}
// open form
// link, let the event be handled via set_route
if ($target.is("a")) { return; }
// clicked on the row, open form
const $row = $(e.currentTarget);
const link = $row.find(".list-subject a").get(0);
if (link) {

View file

@ -24,9 +24,11 @@ $(window).on('hashchange', function() {
}
});
window.addEventListener('popstate', () => {
window.addEventListener('popstate', (e) => {
// forward-back button, just re-render based on current route
frappe.router.route();
e.preventDefault();
return false;
});
// routing v2, capture all clicks so that the target is managed with push-state