]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/plugins-customhr.js
Audit Log: Fixed bad reference to linked entity item
[bookstack] / resources / js / wysiwyg / plugins-customhr.js
index d484284cad24afb14b926ad3e7e9aa2e1e4e3a9b..f5da947f21c151a16cba5922b9586956dd63eb67 100644 (file)
@@ -1,29 +1,26 @@
 /**
  * @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);
     });
 
-    editor.ui.registry.addButton('hr', {
+    editor.ui.registry.addButton('customhr', {
         icon: 'horizontal-rule',
         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
+}