rmr-util 1.1.144 → 1.1.146

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -919,7 +919,7 @@
919
919
  const
920
920
  inputs = form.querySelectorAll('select,input,textarea'),
921
921
  params = {};
922
- //
922
+ //
923
923
  for (const i in inputs) {
924
924
  if (! objectHas(inputs, i)) {
925
925
  continue;
@@ -1310,6 +1310,23 @@
1310
1310
  Base64: Base64,
1311
1311
 
1312
1312
  Tools: {
1313
+
1314
+ tableOfContents: function() {
1315
+ const links = Array.from(document.querySelectorAll('a[href^="#"]'));
1316
+ links.forEach(l => {
1317
+ l.addEventListener('click', e => {
1318
+ const a = ancestor(e.target, 'a', true);
1319
+ if (! a) { return; }
1320
+
1321
+ const target = document.querySelector(a.getAttribute('href'));
1322
+ if (! target) { return; }
1323
+
1324
+ scrollTo(target, 250);
1325
+ e.preventDefault();
1326
+ });
1327
+ });
1328
+ },
1329
+
1313
1330
  debug: function(/*options*/) {
1314
1331
 
1315
1332
  const
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rmr-util",
3
- "version": "1.1.144",
3
+ "version": "1.1.146",
4
4
  "description": "JS & CSS for your browser",
5
5
  "url": "https://davidfmiller.github.io/rmr-util/",
6
6
  "license": "ISC",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "https://github.com/davidfmiller/rmr-util.git"
16
+ "url": "git+https://github.com/davidfmiller/rmr-util.git"
17
17
  },
18
18
  "bugs": {
19
19
  "url": "https://github.com/davidfmiller/rmr-util/issues"
@@ -77,6 +77,7 @@ div.grecaptcha-badge {
77
77
  }
78
78
 
79
79
 
80
+ & > object,
80
81
  & > video,
81
82
  & > svg,
82
83
  & > div,