mirror of
https://github.com/videojs/video.js.git
synced 2025-01-10 23:30:03 +02:00
Updated event fixing to support IE8 and Firefox
This commit is contained in:
parent
bdb4456c62
commit
a73f0ab6f0
@ -167,11 +167,15 @@ vjs.fixEvent = function(event) {
|
||||
if (!event || !event.isPropagationStopped) {
|
||||
var old = event || window.event;
|
||||
|
||||
event = {};
|
||||
// Clone the old object so that we can modify the values event = {};
|
||||
event = vjs.obj.copy(old);
|
||||
// Firefox returns false for event.hasOwnProperty('type'),
|
||||
// so it was getting lost in the object copy
|
||||
event.type = old.type;
|
||||
// IE8 Doesn't like when you mess with native event properties
|
||||
// Firefox returns false for event.hasOwnProperty('type') and other props
|
||||
// which makes copying more difficult.
|
||||
// TODO: Probably best to create a whitelist of event props
|
||||
for (var key in old) {
|
||||
event[key] = old[key];
|
||||
}
|
||||
|
||||
// The event occurred on this element
|
||||
if (!event.target) {
|
||||
|
Loading…
Reference in New Issue
Block a user