X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c6ad16dba657c82512ae495a4a38b99b8cfa9eeb..refs/pull/4286/head:/resources/js/wysiwyg/scrolling.js diff --git a/resources/js/wysiwyg/scrolling.js b/resources/js/wysiwyg/scrolling.js index f14ef4c64..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 @@ -26,4 +13,17 @@ function scrollToText(editor, scrollId) { editor.selection.select(element, true); editor.selection.collapse(false); editor.focus(); -} \ No newline at end of file +} + +/** + * 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); + } +}