File tree Expand file tree Collapse file tree
hyper-component/lib/hyperstack
hyper-model/lib/reactive_record/active_record/reactive_record Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def resources_loaded?
1616 if Hyperstack ::Component ::IsomorphicHelpers . on_opal_client?
1717 %x{
1818 function onError(event) {
19- if (event.message.startsWith(' Uncaught NotQuiet: ' )) event.preventDefault();
19+ if (event.message.match(/^ Uncaught NotQuiet: / )) event.preventDefault();
2020 }
2121
2222 window.addEventListener('error', onError);
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def self.create_native_react_class(type)
109109 this.__opalInstanceSyncSetState = false;
110110 }
111111 },
112- shouldComponentUpdate(next_props, next_state) {
112+ shouldComponentUpdate: function (next_props, next_state) {
113113 if (#{ type . method_defined? :should_component_update? } ) {
114114 this.__opalInstanceSyncSetState = false;
115115 return this.__opalInstance["$should_component_update?"](Opal.Hash.$new(next_props), Opal.Hash.$new(next_state));
Original file line number Diff line number Diff line change @@ -478,6 +478,27 @@ def component_did_update(*args)
478478 reactive_record_link_set_while_loading_container_class
479479 end
480480
481+ # This is required to support legacy browsers (Internet Explorer 9+)
482+ # https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
483+ `
484+ if (!Element.prototype.matches) {
485+ Element.prototype.matches = Element.prototype.msMatchesSelector ||
486+ Element.prototype.webkitMatchesSelector;
487+ }
488+
489+ if (!Element.prototype.closest) {
490+ Element.prototype.closest = function(s) {
491+ var el = this;
492+
493+ do {
494+ if (el.matches(s)) return el;
495+ el = el.parentElement || el.parentNode;
496+ } while (el !== null && el.nodeType === 1);
497+ return null;
498+ };
499+ }
500+ `
501+
481502 def reactive_record_link_to_enclosing_while_loading_container
482503 # Call after any component mounts - attaches the containers loading id to this component
483504 # Fyi, the while_loading container is responsible for setting its own link to itself
You can’t perform that action at this time.
0 commit comments