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

@internetstiftelsen/styleguide

Package Overview
Dependencies
Maintainers
0
Versions
681
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internetstiftelsen/styleguide - npm Package Compare versions

Comparing version 4.0.12-beta.0.2 to 4.0.12-beta.0.3

8

dist/assets/js/iconToggle.js
'use strict';
// Usage: data-toggle-target="toggleButton" data-toggle-icon="copy|check"
// Usage: data-toggle-icon-target="targetSvg" data-toggle-icon="copy|check"
function toggleIconOnClick(e) {

@@ -10,10 +10,9 @@ e.preventDefault();

var target = el.dataset.toggleIconTarget ? document.getElementById(el.dataset.toggleIconTarget) : el;
var i = parseInt(el.dataset.iteration || 0, 10);
var i = parseInt(el.dataset.iconIteration || 0, 10);
var options = el.dataset.toggleIcon.split('|');
var nextIteration = i + 1 === options.length ? 0 : i + 1;
el.dataset.iteration = nextIteration;
el.dataset.iconIteration = nextIteration;
var useElement = target.querySelector('use');
useElement.setAttribute('xlink:href', '#icon-' + options[nextIteration]);
console.log(target);
}

@@ -24,2 +23,3 @@

if (e.target.closest('[data-toggle-icon]')) {
console.log(e.target);
toggleIconOnClick(e);

@@ -26,0 +26,0 @@ return false;

{
"name": "@internetstiftelsen/styleguide",
"version": "4.0.12-beta.0.2",
"version": "4.0.12-beta.0.3",
"main": "dist/components.js",

@@ -5,0 +5,0 @@ "ports": {

@@ -1,2 +0,2 @@

// Usage: data-toggle-target="toggleButton" data-toggle-icon="copy|check"
// Usage: data-toggle-icon-target="targetSvg" data-toggle-icon="copy|check"
function toggleIconOnClick(e) {

@@ -8,10 +8,9 @@ e.preventDefault();

const target = (el.dataset.toggleIconTarget) ? document.getElementById(el.dataset.toggleIconTarget) : el;
const i = parseInt(el.dataset.iteration || 0, 10);
const i = parseInt(el.dataset.iconIteration || 0, 10);
const options = el.dataset.toggleIcon.split('|');
const nextIteration = (i + 1) === options.length ? 0 : i + 1;
el.dataset.iteration = nextIteration;
el.dataset.iconIteration = nextIteration;
const useElement = target.querySelector('use');
useElement.setAttribute('xlink:href', `#icon-${options[nextIteration]}`);
console.log(target);
}

@@ -22,2 +21,3 @@

if (e.target.closest('[data-toggle-icon]')) {
console.log(e.target);
toggleIconOnClick(e);

@@ -24,0 +24,0 @@ return false;

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