Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1309: fix adding/removing event handlers in IE8 #1363

Merged
merged 1 commit into from
Jul 29, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ vjs.on = function(elem, type, fn){
}

if (data.handlers[type].length == 1) {
if (document.addEventListener) {
if (elem.addEventListener) {
elem.addEventListener(type, data.dispatcher, false);
} else if (document.attachEvent) {
} else if (elem.attachEvent) {
elem.attachEvent('on' + type, data.dispatcher);
}
}
Expand Down Expand Up @@ -136,9 +136,9 @@ vjs.cleanUpEvents = function(elem, type) {
// Setting to null was causing an error with data.handlers

// Remove the meta-handler from the element
if (document.removeEventListener) {
if (elem.removeEventListener) {
elem.removeEventListener(type, data.dispatcher, false);
} else if (document.detachEvent) {
} else if (elem.detachEvent) {
elem.detachEvent('on' + type, data.dispatcher);
}
}
Expand Down