File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
hyper-component/lib/hyperstack
hyper-model/lib/reactive_record/active_record/reactive_record Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def resources_loaded?
16
16
if Hyperstack ::Component ::IsomorphicHelpers . on_opal_client?
17
17
%x{
18
18
function onError(event) {
19
- if (event.message.startsWith(' Uncaught NotQuiet: ' )) event.preventDefault();
19
+ if (event.message.match(/^ Uncaught NotQuiet: / )) event.preventDefault();
20
20
}
21
21
22
22
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)
109
109
this.__opalInstanceSyncSetState = false;
110
110
}
111
111
},
112
- shouldComponentUpdate(next_props, next_state) {
112
+ shouldComponentUpdate: function (next_props, next_state) {
113
113
if (#{ type . method_defined? :should_component_update? } ) {
114
114
this.__opalInstanceSyncSetState = false;
115
115
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)
478
478
reactive_record_link_set_while_loading_container_class
479
479
end
480
480
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
+
481
502
def reactive_record_link_to_enclosing_while_loading_container
482
503
# Call after any component mounts - attaches the containers loading id to this component
483
504
# 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