hlp 3.8.5 → 3.8.6
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/README.md +3 -3
- package/_js/_build/script.js +2103 -2869
- package/package.json +25 -37
package/README.md
CHANGED
|
@@ -448,7 +448,7 @@ hlp.outerHeightWithMargin( document.querySelector('.foo') )
|
|
|
448
448
|
// get cursor position (without mouse events)
|
|
449
449
|
hlp.cursorPosition().then(pos => { console.log(pos); /* pos: { x: ..., y: ... } */ });
|
|
450
450
|
|
|
451
|
-
//
|
|
451
|
+
// dom compatibility helpers
|
|
452
452
|
hlp.closest( document.querySelector('.children'), '.parent' )
|
|
453
453
|
hlp.matches( document.querySelector('.parent'), '.parent' ) // true
|
|
454
454
|
hlp.remove( document.querySelector('.foo') ) // also works if .foo does not exist
|
|
@@ -476,7 +476,7 @@ hlp.wrap( document.querySelector('.foo'), '<div class="wrapper"></div>' )
|
|
|
476
476
|
// wrap all text nodes with new node
|
|
477
477
|
hlp.wrapTextNodes( document.querySelector('.foo'), 'p' )
|
|
478
478
|
|
|
479
|
-
// html string to dom (also supports
|
|
479
|
+
// html string to dom (also supports td nodes that cannot be root nodes)
|
|
480
480
|
hlp.html2dom('<p>foo</p>')
|
|
481
481
|
hlp.html2dom('<td>bar</td>')
|
|
482
482
|
|
|
@@ -583,7 +583,7 @@ hlp.triggerAfterAllImagesLoaded('.container', '.container__image', () => {});
|
|
|
583
583
|
hlp.ready().then(() => {});
|
|
584
584
|
hlp.load().then(() => {});
|
|
585
585
|
|
|
586
|
-
// easy ajax requests (without the fetch api
|
|
586
|
+
// easy ajax requests (without the fetch api)
|
|
587
587
|
hlp.get('https://httpbin.org/anything').then((response) => { }).catch((error) => { }) // { "method": "GET", ... }
|
|
588
588
|
hlp.get('/relpath').then((response) => { }).catch((error) => { }) // if a full url is omitted, the call is done on the baseurl
|
|
589
589
|
hlp.get('https://httpbin.org/anything', { throttle: 1000 }).then((response) => { }).catch((error) => { }) // same but with a throttle of 1 second
|