X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/e711290d8b1ce06b38e0560248806e8de2077870..refs/pull/4467/head:/resources/js/wysiwyg/scrolling.js diff --git a/resources/js/wysiwyg/scrolling.js b/resources/js/wysiwyg/scrolling.js index faeb837a4..92f8f1583 100644 --- a/resources/js/wysiwyg/scrolling.js +++ b/resources/js/wysiwyg/scrolling.js @@ -1,16 +1,3 @@ -/** - * Scroll to a section dictated by the current URL query string, if present. - * Used when directly editing a specific section of the page. - * @param {Editor} editor - */ -export function scrollToQueryString(editor) { - const queryParams = (new URL(window.location)).searchParams; - const scrollId = queryParams.get('content-id'); - if (scrollId) { - scrollToText(editor, scrollId); - } -} - /** * @param {Editor} editor * @param {String} scrollId @@ -27,3 +14,16 @@ function scrollToText(editor, scrollId) { editor.selection.collapse(false); editor.focus(); } + +/** + * Scroll to a section dictated by the current URL query string, if present. + * Used when directly editing a specific section of the page. + * @param {Editor} editor + */ +export function scrollToQueryString(editor) { + const queryParams = (new URL(window.location)).searchParams; + const scrollId = queryParams.get('content-id'); + if (scrollId) { + scrollToText(editor, scrollId); + } +}