dom-helpers icon indicating copy to clipboard operation
dom-helpers copied to clipboard

README

Open PixnBits opened this issue 9 years ago • 2 comments

In the README the insertion of the line

It does expect certain, polyfillable, es5 features to be present for which you can use es5-shim for ie8

disturbs the flow of thoughts, currently:

For example events.on works in all browsers ie8+ but it uses the native event system so actual event oddities will continue to exist. If you need robust cross-browser support, use jQuery. If you are just tired of rewriting:

It does expect certain, polyfillable, es5 features to be present for which you can use es5-shim for ie8

if (document.addEventListener)
 return (node, eventName, handler, capture) =>
   node.addEventListener(eventName, handler, capture || false);
else if (document.attachEvent)
 return (node, eventName, handler) =>
     node.attachEvent('on' + eventName, handler);

over and over again, or you need a ok getComputedStyle polyfill but don't want to include all of jQuery, use this.

I was going to open a PR but thought to first ask if there is preference on where to move that line? I was thinking of moving the line to after the thought ends, possibly in parentheses:

For example events.on works in all browsers ie8+ but it uses the native event system so actual event oddities will continue to exist. If you need robust cross-browser support, use jQuery. If you are just tired of rewriting:

if (document.addEventListener)
 return (node, eventName, handler, capture) =>
   node.addEventListener(eventName, handler, capture || false);
else if (document.attachEvent)
 return (node, eventName, handler) =>
     node.attachEvent('on' + eventName, handler);

over and over again, or you need a ok getComputedStyle polyfill but don't want to include all of jQuery, use this.

dom-helpers does expect certain, polyfillable, es5 features to be present for which you can use es5-shim for ie8

or

... over and over again, or you need a ok getComputedStyle polyfill but don't want to include all of jQuery, use this. (It does expect certain, polyfillable, es5 features to be present for which you can use es5-shim for ie8)

PixnBits avatar Jan 04 '17 01:01 PixnBits

the first seems fine. It's a fairly important installation instruction so i'd prefer it not to be an aside. but yeah go for it with the PR if you want

jquense avatar Jan 04 '17 02:01 jquense

Cheers, PR open very understandable re: installation instruction 👍

PixnBits avatar Jan 05 '17 07:01 PixnBits