@humblejs/lib
Advanced tools
Comparing version 1.10.23 to 1.10.24
@@ -54,2 +54,4 @@ 'use strict'; | ||
var tocLinkClick = function tocLinkClick(e, gaEvent) { | ||
var topOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
if (!(0, _browser.isBrowser)()) { | ||
@@ -59,3 +61,3 @@ return; | ||
var to = e.target.getAttribute("to").substr(1); | ||
(0, _windowUtils.scrollTo)(document.getElementById(to)); | ||
(0, _windowUtils.scrollTo)(document.getElementById(to), topOffset); | ||
@@ -72,3 +74,5 @@ (0, _windowUtils.updateLocationHash)(to); | ||
_ref$initiallyOpen = _ref.initiallyOpen, | ||
initiallyOpen = _ref$initiallyOpen === undefined ? true : _ref$initiallyOpen; | ||
initiallyOpen = _ref$initiallyOpen === undefined ? true : _ref$initiallyOpen, | ||
_ref$topOffset = _ref.topOffset, | ||
topOffset = _ref$topOffset === undefined ? 0 : _ref$topOffset; | ||
@@ -167,4 +171,8 @@ if (!(0, _browser.isBrowser)() || document.querySelectorAll(parentSelector).length === 0) { | ||
for (var i = 0; i < tocLinks.length; ++i) { | ||
tocLinks[i].removeEventListener("click", tocLinkClick); | ||
tocLinks[i].addEventListener("click", tocLinkClick); | ||
tocLinks[i].removeEventListener("click", function (evt) { | ||
return tocLinkClick(evt, null, topOffset); | ||
}); | ||
tocLinks[i].addEventListener("click", function (evt) { | ||
return tocLinkClick(evt, null, topOffset); | ||
}); | ||
} | ||
@@ -171,0 +179,0 @@ |
{ | ||
"name": "@humblejs/lib", | ||
"version": "1.10.23", | ||
"version": "1.10.24", | ||
"main": "dist/export.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/export.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27746
532