X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/4c75358abd48847b683fdf1e2c89ee9f044a5d60..refs/pull/4467/head:/resources/js/wysiwyg/plugins-customhr.js diff --git a/resources/js/wysiwyg/plugins-customhr.js b/resources/js/wysiwyg/plugins-customhr.js index df1984d4e..f5da947f2 100644 --- a/resources/js/wysiwyg/plugins-customhr.js +++ b/resources/js/wysiwyg/plugins-customhr.js @@ -1,12 +1,11 @@ /** * @param {Editor} editor - * @param {String} url */ -function register(editor, url) { - editor.addCommand('InsertHorizontalRule', function () { - let hrElem = document.createElement('hr'); - let cNode = editor.selection.getNode(); - let parentNode = cNode.parentNode; +function register(editor) { + editor.addCommand('InsertHorizontalRule', () => { + const hrElem = document.createElement('hr'); + const cNode = editor.selection.getNode(); + const {parentNode} = cNode; parentNode.insertBefore(hrElem, cNode); }); @@ -15,15 +14,13 @@ function register(editor, url) { tooltip: 'Insert horizontal line', onAction() { editor.execCommand('InsertHorizontalRule'); - } + }, }); } - /** - * @param {WysiwygConfigOptions} options * @return {register} */ -export function getPlugin(options) { +export function getPlugin() { return register; -} \ No newline at end of file +}