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

@ndla/article-scripts

Package Overview
Dependencies
Maintainers
4
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.12 to 0.5.13

21

es/footnoteScripts.js

@@ -9,3 +9,3 @@ /**

import jump from 'jump.js';
import { forEachElement, inIframe, getElementOffset } from './domHelpers';
import { forEachElement, inIframe } from './domHelpers';
export var addFootnoteClickListeners = function addFootnoteClickListeners() {

@@ -18,19 +18,10 @@ forEachElement('.c-footnotes__ref sup a, .c-footnotes__cite sup a', function (el) {

e.preventDefault();
var scrollTarget = document.getElementById(hash.slice(1));
var scrollOffset = inIframe() ? -100 : -200; // different offset because of no menu in iFrame
if (inIframe() && window.parent) {
var elementOffset = getElementOffset(scrollTarget);
window.parent.postMessage({
event: 'scrollTo',
top: elementOffset.top - 100 // different offset because of no menu in iframe.
}, '*');
} else {
jump(hash, {
offset: -200,
duration: 300
});
}
jump(hash, {
offset: scrollOffset,
duration: 300
});
};
});
};

@@ -28,17 +28,8 @@ "use strict";

e.preventDefault();
var scrollTarget = document.getElementById(hash.slice(1));
var scrollOffset = (0, _domHelpers.inIframe)() ? -100 : -200; // different offset because of no menu in iFrame
if ((0, _domHelpers.inIframe)() && window.parent) {
var elementOffset = (0, _domHelpers.getElementOffset)(scrollTarget);
window.parent.postMessage({
event: 'scrollTo',
top: elementOffset.top - 100 // different offset because of no menu in iframe.
}, '*');
} else {
(0, _jump.default)(hash, {
offset: -200,
duration: 300
});
}
(0, _jump.default)(hash, {
offset: scrollOffset,
duration: 300
});
};

@@ -45,0 +36,0 @@ });

{
"name": "@ndla/article-scripts",
"version": "0.5.12",
"version": "0.5.13",
"description": "A collection of functions for making article content responsive (and interactive)",

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

},
"gitHead": "1b251643714d8c6167af3e9219d35e1af0602268"
"gitHead": "edeb7d9691fa512a1e059fae47028cfd83a9684b"
}
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