Skip to content

Commit

Permalink
fix(formatting): use snake case for variable names
Browse files Browse the repository at this point in the history
(cherry picked from commit ccbd6ff)
  • Loading branch information
NagariaHussain authored and mergify[bot] committed Oct 27, 2022
1 parent 1b70ec4 commit 32851ce
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frappe/public/js/frappe/router.js
Expand Up @@ -38,13 +38,13 @@ $("body").on("click", "a", function (e) {
return false;
};

const targetElement = e.currentTarget;
const href = targetElement.getAttribute("href");
const isOfSameHost = targetElement.hostname === window.location.hostname;
const target_element = e.currentTarget;
const href = target_element.getAttribute("href");
const is_on_same_host = target_element.hostname === window.location.hostname;

// click handled, but not by href
if (
targetElement.getAttribute("onclick") || // has a handler
target_element.getAttribute("onclick") || // has a handler
e.ctrlKey ||
e.metaKey || // open in a new tab
href === "#" // hash is home
Expand All @@ -58,20 +58,20 @@ $("body").on("click", "a", function (e) {

if (href && href.startsWith("#")) {
// target startswith "#", this is a v1 style route, so remake it.
return override(targetElement.hash);
return override(target_element.hash);
}

if (isOfSameHost && frappe.router.is_app_route(targetElement.pathname)) {
if (is_on_same_host && frappe.router.is_app_route(target_element.pathname)) {
// target has "/app, this is a v2 style route.

if (targetElement.search) {
if (target_element.search) {
frappe.route_options = {};
let params = new URLSearchParams(targetElement.search);
let params = new URLSearchParams(target_element.search);
for (const [key, value] of params) {
frappe.route_options[key] = value;
}
}
return override(targetElement.pathname + targetElement.hash);
return override(target_element.pathname + target_element.hash);
}
});

Expand Down

0 comments on commit 32851ce

Please sign in to comment.