New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@acanto/components-locale-switch

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acanto/components-locale-switch - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

index.blade.php

46

index.js
import { $$, forEach, on, getDataAttr } from "@acanto/core-dom";
import { octoberRequest } from "@acanto/core-october";
import "./index.scss";
/**
* October's locale switch component
* TODO: Locale switch component
*

@@ -11,26 +10,21 @@ * @param {string} [rootSelector=".LocaleSwitch:"]

export default function localeSwitch(rootSelector = ".LocaleSwitch:") {
function handleSwitch($root) {
const locale = getDataAttr($root, "locale");
const request = octoberRequest("onSwitchLocale", { locale });
$root.classList.add("loading");
request
.then(({ data }) => {
if (data["X_OCTOBER_REDIRECT"]) {
location.href = data["X_OCTOBER_REDIRECT"];
}
})
.catch(() => {
$root.classList.remove("loading");
});
}
forEach($$(rootSelector), ($root) => {
on($root, "click", () => {
if (!$root.classList.contains("is-active")) {
handleSwitch($root);
}
});
});
// function handleSwitch($root) {
// const locale = getDataAttr($root, "locale");
// $root.classList.add("loading");
// request
// .then(({ data }) => {
// location.href = data;
// }
// })
// .catch(() => {
// $root.classList.remove("loading");
// });
// }
// forEach($$(rootSelector), ($root) => {
// on($root, "click", () => {
// if (!$root.classList.contains("is-active")) {
// handleSwitch($root);
// }
// });
// });
}
{
"name": "@acanto/components-locale-switch",
"version": "0.0.3",
"version": "0.0.4",
"author": "Acanto <info@acanto.net> (https://acanto.agency/)",

@@ -15,6 +15,5 @@ "license": "ISC",

"dependencies": {
"@acanto/core-dom": "^0.0.3",
"@acanto/core-october": "^0.0.3"
"@acanto/core-dom": "^0.0.3"
},
"gitHead": "ece5ff7e3930f6925661a62e92b83d42857bdaf3"
"gitHead": "0aa3c21c899ba912381a7116c945bfb4b89ac75f"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc