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

h5p-lib-controls

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h5p-lib-controls - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "h5p-lib-controls",
"version": "0.0.6",
"version": "0.0.7",
"description": "Library for adding user input to web applications",

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

@@ -124,2 +124,3 @@ import { setAttribute, removeAttribute, hasAttribute } from 'h5p-sdk/src/scripts/utils/elements';

* @param {HTMLElement} el
* @param {number} position
*

@@ -129,2 +130,20 @@ * @fires Controls#addElement

*/
insertElementAt(el, position) {
this.elements.splice(position, 0, el);
this.firesEvent('addElement', el);
if (this.elements.length === 1) { // if first
this.setTabbable(el);
}
}
/**
* Add controls to an element
*
* @param {HTMLElement} el
*
* @fires Controls#addElement
* @public
*/
removeElement(el) {

@@ -131,0 +150,0 @@ this.elements = without([el], this.elements);

@@ -9,3 +9,3 @@ import Controls from '../src/scripts/controls';

controls = new Controls();
elements = [document.createElement("div"), document.createElement("div"), document.createElement("div")];
elements = [document.createElement("div"), document.createElement("a"), document.createElement("p")];
});

@@ -23,2 +23,11 @@

it("should add elements at a given position", function () {
// add elements to controls
elements.forEach(el => controls.insertElementAt(el, 0));
expect(controls.elements[0]).toBe(elements[2]);
expect(controls.elements[1]).toBe(elements[1]);
expect(controls.elements[2]).toBe(elements[0]);
});
it("should move tabindex on next", function () {

@@ -25,0 +34,0 @@ // add elements to controls

Sorry, the diff of this file is not supported yet

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