I created a moodle block plugin which contains a form.
When a mobile user try to use the form, the resizing of the window due to popup of the keyboard closed the drawer block, I tried to investigate which event listener causes this and here is the code of the handler:
define("core/utils", ["exports"], (function(_exports) {
Object.defineProperty(_exports, "__esModule", {
value: !0
}),
_exports.throttle = _exports.debounce = void 0;
_exports.throttle = (func,wait)=>{
let onCooldown = !1
, runAgain = null;
const run = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
args[_key] = arguments[_key];
runAgain = null !== runAgain,
onCooldown || (func.apply(this, args),
onCooldown = !0,
setTimeout((()=>{
const recurse = runAgain;
onCooldown = !1,
runAgain = null,
recurse && run(args)
}
), wait))
};
return run
}
;
_exports.debounce = (func,wait)=>{
let timeout = null;
return function() { // THIS IS THE HANDLER.
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++)
args[_key2] = arguments[_key2];
clearTimeout(timeout),
timeout = setTimeout((()=>{
func.apply(this, args)
}
), wait)
}
}
}
));
I don't know how to add a code using $this->page->requires->js_init_code($code); to stop this event
Note that I'm using moove (boost child) theme.