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

@financial-times/o-toggle

Package Overview
Dependencies
Maintainers
18
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/o-toggle - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

.remarkrc.js

7

package.json

@@ -28,3 +28,3 @@ {

"name": "@financial-times/o-toggle",
"version": "2.0.3",
"version": "2.0.4",
"dependencies": {},

@@ -34,6 +34,11 @@ "component": "o-toggle",

"devDependencies": {
"eslint": "^7.1.0",
"eslint-config-origami-component": "^2.0.1",
"origami-ci-tools": "^2.0.0",
"remark": "^12.0.0",
"remark-lint": "^7.0.0",
"remark-preset-lint-origami-component": "^1.1.1",
"stylelint": "^13.5.0",
"stylelint-config-origami-component": "^1.0.2"
}
}

47

README.md

@@ -6,4 +6,5 @@ # o-toggle [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](#licence)

- [Markup](#markup)
- [Sass](#sass)
- [JavaScript](#javascript)
- [Sass](#sass)
- [Migration guide](#migration-guide)
- [Contact](#contact)

@@ -27,9 +28,9 @@ - [Licence](#licence)

<script>
window.myToggleCallback = function(state, event) {
if (state === 'open') {
console.log('Target opened');
} else if (state === 'close') {
console.log('Target closed');
}
};
window.myToggleCallback = function(state, event) {
if (state === 'open') {
console.log('Target opened');
} else if (state === 'close') {
console.log('Target closed');
}
};
</script>

@@ -65,3 +66,3 @@ <button data-o-component="o-toggle" data-o-toggle-target="#my-target" data-o-toggle-callback="myToggleCallback">My button</button>

document.addEventListener("DOMContentLoaded", function() {
document.dispatchEvent(new CustomEvent('o.DOMContentLoaded'));
document.dispatchEvent(new CustomEvent('o.DOMContentLoaded'));
});

@@ -82,11 +83,11 @@ ```

const toggle = new Toggle(toggleEl, {
target: '.my-target',
callback: function(state, event) {
if (state === 'open') {
console.log('Target opened');
} else if (state === 'close') {
console.log('Target closed');
}
}
});
target: '.my-target',
callback: function(state, event) {
if (state === 'open') {
console.log('Target opened');
} else if (state === 'close') {
console.log('Target closed');
}
}
});
```

@@ -96,8 +97,8 @@

- *target*: HTMLElement or selector of the element that will be toggled
- *callback*: Function or content of a function as _string_ that will be executed every time a toggle happens. It has the following parameters:
- State. 'open' or 'close'
- Click event object if it comes from the event handler on the toggle
- _target_: HTMLElement or selector of the element that will be toggled
- _callback_: Function or content of a function as _string_ that will be executed every time a toggle happens. It has the following parameters:
- State. 'open' or 'close'
- Click event object if it comes from the event handler on the toggle
## Migration
## Migration guide

@@ -104,0 +105,0 @@ State | Major Version | Last Minor Release | Migration guide |

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