diff --git a/framework/core/js/src/common/components/ConfirmDocumentUnload.js b/framework/core/js/src/common/components/ConfirmDocumentUnload.js index 063fb79747..95cc1ea92c 100644 --- a/framework/core/js/src/common/components/ConfirmDocumentUnload.js +++ b/framework/core/js/src/common/components/ConfirmDocumentUnload.js @@ -19,13 +19,13 @@ export default class ConfirmDocumentUnload extends Component { super.oncreate(vnode); this.boundHandler = this.handler.bind(this); - $(window).on('beforeunload', this.boundHandler); + window.addEventListener('beforeunload', this.boundHandler); } onremove(vnode) { super.onremove(vnode); - $(window).off('beforeunload', this.boundHandler); + window.removeEventListener('beforeunload', this.boundHandler); } view(vnode) { diff --git a/framework/core/js/src/common/utils/anchorScroll.js b/framework/core/js/src/common/utils/anchorScroll.js index d188852610..35056cd6d5 100644 --- a/framework/core/js/src/common/utils/anchorScroll.js +++ b/framework/core/js/src/common/utils/anchorScroll.js @@ -12,6 +12,8 @@ * @param {() => void} callback The callback to run that will change page content. */ export default function anchorScroll(element, callback) { + if (typeof element === 'string') element = document.querySelector(element); + if (!element) return; const relativeScroll = element.getBoundingClientRect().top; callback();