]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/plugins-details.js
Updated attachment links to have dropdown for open type
[bookstack] / resources / js / wysiwyg / plugins-details.js
index 9b5287947c406d026b7ce2bc21c69eaa589f45e0..bcecf7131e5eeb1125f32ca9d79a05b6e091e7da 100644 (file)
@@ -169,6 +169,7 @@ function setSummary(editor, summaryContent) {
  */
 function unwrapDetailsInSelection(editor) {
     const details = editor.selection.getNode().closest('details');
+    const selectionBm = editor.selection.getBookmark();
 
     if (details) {
         const elements = details.querySelectorAll('details > *:not(summary, doc-root), doc-root > *');
@@ -180,7 +181,9 @@ function unwrapDetailsInSelection(editor) {
             details.remove();
         });
     }
+
     editor.focus();
+    editor.selection.moveToBookmark(selectionBm);
 }
 
 /**