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

contao-utils-bundle

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contao-utils-bundle - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

6

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
## [1.1.0] - 2018-12-14
### Added
- dom.scrollTo
- dom.elementInViewport
## [1.0.5] - 2018-10-29

@@ -5,0 +11,0 @@

@@ -12,2 +12,32 @@ module.exports = {

},
scrollTo: function(element, offset = 0, delay = 0, force = false) {
let rect = element.getBoundingClientRect();
let scrollPosition = (rect.top + window.pageYOffset - offset);
setTimeout(() => {
if (!this.elementInViewport(element) || force === true)
window.scrollTo({
'top': scrollPosition,
'behavior': 'smooth',
});
}, delay);
},
elementInViewport: function(el) {
let top = el.offsetTop;
let left = el.offsetLeft;
let width = el.offsetWidth;
let height = el.offsetHeight;
while (el.offsetParent) {
el = el.offsetParent;
top += el.offsetTop;
left += el.offsetLeft;
}
return (
top < (window.pageYOffset + window.innerHeight) &&
left < (window.pageXOffset + window.innerWidth) &&
(top + height) > window.pageYOffset &&
(left + width) > window.pageXOffset
);
},
};

2

package.json
{
"name": "contao-utils-bundle",
"version": "1.0.5",
"version": "1.1.0",
"description": "This package contains the frontend assets of the composer bundle heimrichhannot/contao-utils-bundle.",

@@ -5,0 +5,0 @@ "main": "js/utils-bundle",

# Contao Utils Bundle Assets
This package contains the frontend assets of the composer bundle heimrichhannot/contao-utils-bundle.
This package contains the frontend assets of the composer bundle [heimrichhannot/contao-utils-bundle](https://github.com/heimrichhannot/contao-utils-bundle).
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