Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 6dc2d5c

Browse files
Fixing Issue #694
1 parent 38224e7 commit 6dc2d5c

26 files changed

Lines changed: 77 additions & 72 deletions

dist/rx.all.compat.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6653,13 +6653,13 @@
66536653
* @returns {boolean}
66546654
*/
66556655
function isNodeList(el) {
6656-
if (window.StaticNodeList) {
6657-
// IE8 Specific
6658-
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
6659-
return (el instanceof window.StaticNodeList || el instanceof NodeList);
6660-
} else {
6661-
return (Object.prototype.toString.call(el) == '[object NodeList]')
6662-
}
6656+
if (window.StaticNodeList) {
6657+
// IE8 Specific
6658+
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
6659+
return (el instanceof window.StaticNodeList || el instanceof NodeList);
6660+
} else {
6661+
return (Object.prototype.toString.call(el) == '[object NodeList]')
6662+
}
66636663
}
66646664
function fixEvent(event) {
66656665
var stopPropagation = function () {
@@ -6743,7 +6743,7 @@
67436743
var disposables = new CompositeDisposable();
67446744

67456745
// Asume NodeList
6746-
if (isNodeList(el)) {
6746+
if (isNodeList(el) || Object.prototype.toString.call(el) === '[object HTMLCollection]') {
67476747
for (var i = 0, len = el.length; i < len; i++) {
67486748
disposables.add(createEventListener(el.item(i), eventName, handler));
67496749
}

dist/rx.all.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.compat.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6515,8 +6515,9 @@
65156515
function createEventListener (el, eventName, handler) {
65166516
var disposables = new CompositeDisposable();
65176517

6518-
// Asume NodeList
6519-
if (Object.prototype.toString.call(el) === '[object NodeList]') {
6518+
// Asume NodeList or HTMLCollection
6519+
var toStr = Object.prototype.toString;
6520+
if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
65206521
for (var i = 0, len = el.length; i < len; i++) {
65216522
disposables.add(createEventListener(el.item(i), eventName, handler));
65226523
}

dist/rx.all.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.async.compat.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,13 @@
385385
* @returns {boolean}
386386
*/
387387
function isNodeList(el) {
388-
if (window.StaticNodeList) {
389-
// IE8 Specific
390-
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
391-
return (el instanceof window.StaticNodeList || el instanceof NodeList);
392-
} else {
393-
return (Object.prototype.toString.call(el) == '[object NodeList]')
394-
}
388+
if (window.StaticNodeList) {
389+
// IE8 Specific
390+
// instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
391+
return (el instanceof window.StaticNodeList || el instanceof NodeList);
392+
} else {
393+
return (Object.prototype.toString.call(el) == '[object NodeList]')
394+
}
395395
}
396396
function fixEvent(event) {
397397
var stopPropagation = function () {
@@ -475,7 +475,7 @@
475475
var disposables = new CompositeDisposable();
476476

477477
// Asume NodeList
478-
if (isNodeList(el)) {
478+
if (isNodeList(el) || Object.prototype.toString.call(el) === '[object HTMLCollection]') {
479479
for (var i = 0, len = el.length; i < len; i++) {
480480
disposables.add(createEventListener(el.item(i), eventName, handler));
481481
}

dist/rx.async.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.async.compat.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.async.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,9 @@
392392
function createEventListener (el, eventName, handler) {
393393
var disposables = new CompositeDisposable();
394394

395-
// Asume NodeList
396-
if (Object.prototype.toString.call(el) === '[object NodeList]') {
395+
// Asume NodeList or HTMLCollection
396+
var toStr = Object.prototype.toString;
397+
if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
397398
for (var i = 0, len = el.length; i < len; i++) {
398399
disposables.add(createEventListener(el.item(i), eventName, handler));
399400
}

0 commit comments

Comments
 (0)