mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
ESLINT: Started inital pass at addressing issues
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user