Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vaadin-component-factory/vcf-nav

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin-component-factory/vcf-nav - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "@vaadin-component-factory/vcf-nav",
"version": "1.0.5",
"version": "1.0.6",
"homepage": "https://github.com/vaadin-component-factory/vcf-nav",

@@ -5,0 +5,0 @@ "repository": "https://github.com/vaadin-component-factory/vcf-nav",

@@ -162,2 +162,5 @@ import { html, css, LitElement } from 'lit';

color: var(--lumo-contrast-60pct);
font-size: var(--lumo-icon-size-s);
min-width: 1em;
min-height: 1em;
}

@@ -214,9 +217,14 @@

_updateActive() {
const pathRelativeToRoot = document.location.pathname;
const basePath = new URL(document.baseURI).pathname;
const pathWithoutBase = pathRelativeToRoot.substring(basePath.length);
const pathRelativeToBase = (basePath !== pathRelativeToRoot && pathRelativeToRoot.startsWith(basePath)) ? pathWithoutBase : pathRelativeToRoot;
this.active = pathRelativeToBase === this.path;
const hasBaseUri = (document.baseURI != document.location.href);
const pathAbsolute = this.path.startsWith("/");
if (hasBaseUri && !pathAbsolute) {
const pathRelativeToRoot = document.location.pathname;
const basePath = new URL(document.baseURI).pathname;
const pathWithoutBase = pathRelativeToRoot.substring(basePath.length);
const pathRelativeToBase = (basePath !== pathRelativeToRoot && pathRelativeToRoot.startsWith(basePath)) ? pathWithoutBase : pathRelativeToRoot;
this.active = pathRelativeToBase === this.path;
} else {
// Absolute path or no base uri in use. No special comparison needed
this.active = document.location.pathname == this.path;
}
this.toggleAttribute('child-active', document.location.pathname.startsWith(this.path));

@@ -223,0 +231,0 @@

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