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

@ndla/article-scripts

Package Overview
Dependencies
Maintainers
5
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndla/article-scripts - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

24

es/detailsScript.js
import { updateIFrameDimensions } from './figureScripts';
import { forEachElement } from './domHelpers';
var toggleExploded = function toggleExploded(container, isOpen) {
if (!isOpen) {
container.classList.remove('c-details--exploded');
return;
}
var table = container.getElementsByTagName('table')[0];
var tbody = container.getElementsByTagName('tbody')[0];
if (!table || !tbody) {
return;
}
var tbodyWidth = tbody.getBoundingClientRect().width;
var tableWidth = table.getBoundingClientRect().width;
if (tbodyWidth > tableWidth) {
container.classList.add('c-details--exploded');
}
};
var eventListener = function eventListener(event) {
if (event.currentTarget.getAttribute('open') !== null) {
updateIFrameDimensions(false, event.currentTarget);
toggleExploded(event.currentTarget, true);
} else {
toggleExploded(event.currentTarget, false);
}

@@ -8,0 +32,0 @@ };

@@ -12,5 +12,29 @@ "use strict";

var toggleExploded = function toggleExploded(container, isOpen) {
if (!isOpen) {
container.classList.remove('c-details--exploded');
return;
}
var table = container.getElementsByTagName('table')[0];
var tbody = container.getElementsByTagName('tbody')[0];
if (!table || !tbody) {
return;
}
var tbodyWidth = tbody.getBoundingClientRect().width;
var tableWidth = table.getBoundingClientRect().width;
if (tbodyWidth > tableWidth) {
container.classList.add('c-details--exploded');
}
};
var eventListener = function eventListener(event) {
if (event.currentTarget.getAttribute('open') !== null) {
(0, _figureScripts.updateIFrameDimensions)(false, event.currentTarget);
toggleExploded(event.currentTarget, true);
} else {
toggleExploded(event.currentTarget, false);
}

@@ -17,0 +41,0 @@ };

4

package.json
{
"name": "@ndla/article-scripts",
"version": "0.5.5",
"version": "0.5.6",
"description": "A collection of functions for making article content responsive (and interactive)",

@@ -30,3 +30,3 @@ "license": "GPL-3.0",

},
"gitHead": "84b8002661e3569d84ef1d57fc5e57cf2fe6f062"
"gitHead": "9cff94cd0afa90d567e46b80fd3da25a979978cf"
}
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