Skip to content

Commit

Permalink
Feat: Add resize bar to HTMLField
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 1, 2024
1 parent 6a76c81 commit edbc0e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions private/css/cms.tiptap.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ p:not(.is-empty) > br.ProseMirror-trailingBreak {
&.textarea.fixed .tiptap {
border-top-left-radius: 0;
border-top-right-radius: 0;
resize: vertical;
overflow-y: auto;
}
position: relative;
a {
Expand Down
6 changes: 6 additions & 0 deletions private/js/cms.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ class CMSEditor {

// CMS Editor: init_all
initAll () {
// Save the active element
const active = document.activeElement;
// Get global options from script element
try {
this._options = JSON.parse(document.getElementById('cms-editor-cfg').textContent);
Expand All @@ -238,6 +240,10 @@ class CMSEditor {
);
// Register all plugins on the page for inline editing
this.initInlineEditors();
// Re-focus the active element
if (active) {
active.focus();
}
}

// CMS Editor: destroy
Expand Down

0 comments on commit edbc0e3

Please sign in to comment.