From 1ca2b40bf934bc5896051840c12f505e6786c5aa Mon Sep 17 00:00:00 2001 From: shortcutme Date: Thu, 28 Jun 2018 02:39:46 +0200 Subject: [PATCH] Fix IE Edge compatibility on notification button clicks --- src/Ui/media/Wrapper.coffee | 5 +++-- src/Ui/media/all.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Ui/media/Wrapper.coffee b/src/Ui/media/Wrapper.coffee index 39689626..764427fb 100644 --- a/src/Ui/media/Wrapper.coffee +++ b/src/Ui/media/Wrapper.coffee @@ -29,7 +29,7 @@ class Wrapper @opener_tested = false @announcer_line = null - @allowed_event_constructors = [MouseEvent, KeyboardEvent] # Allowed event constructors + @allowed_event_constructors = [window.MouseEvent, window.KeyboardEvent, window.PointerEvent] # Allowed event constructors window.onload = @onPageLoad # On iframe loaded window.onhashchange = (e) => # On hash change @@ -49,7 +49,8 @@ class Wrapper throw "Event not trusted" if e.originalEvent.constructor not in @allowed_event_constructors - throw "Invalid event constructor: #{e.constructor} != #{allowed_event_constructor}" + debugger + throw "Invalid event constructor: #{e.constructor} not in #{JSON.stringify(@allowed_event_constructors)}" if e.originalEvent.currentTarget != allowed_target[0] throw "Invalid event target: #{e.originalEvent.currentTarget} != #{allowed_target[0]}" diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index 1c600620..0cb9d81d 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -714,7 +714,6 @@ jQuery.extend( jQuery.easing, }).call(this); - /* ---- src/Ui/media/Notifications.coffee ---- */ @@ -896,7 +895,7 @@ jQuery.extend( jQuery.easing, this.address = null; this.opener_tested = false; this.announcer_line = null; - this.allowed_event_constructors = [MouseEvent, KeyboardEvent]; + this.allowed_event_constructors = [window.MouseEvent, window.KeyboardEvent, window.PointerEvent]; window.onload = this.onPageLoad; window.onhashchange = (function(_this) { return function(e) { @@ -928,7 +927,8 @@ jQuery.extend( jQuery.easing, throw "Event not trusted"; } if (ref = e.originalEvent.constructor, indexOf.call(this.allowed_event_constructors, ref) < 0) { - throw "Invalid event constructor: " + e.constructor + " != " + allowed_event_constructor; + debugger; + throw "Invalid event constructor: " + e.constructor + " not in " + (JSON.stringify(this.allowed_event_constructors)); } if (e.originalEvent.currentTarget !== allowed_target[0]) { throw "Invalid event target: " + e.originalEvent.currentTarget + " != " + allowed_target[0]; @@ -1731,6 +1731,7 @@ jQuery.extend( jQuery.easing, }).call(this); + /* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */