* zin: add 'full' value for editor size.

This commit is contained in:
dingyongliang
2023-07-27 09:47:42 +08:00
parent 6de363846a
commit ae8fe585ba
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -2,10 +2,11 @@ textarea[size="sm"],
tiptap-editor[size="sm"] {min-height: 142px;}
textarea[size="lg"],
tiptap-editor[size="lg"] {min-height: 250px;}
textarea[size="full"] {min-height: 100%; height: 100%;}
[data-tippy-root] tiptap-menu-item > button {font-size: inherit; font-family: Arial; line-height: normal;}
.editor-container {height: auto; width: 100%;}
.editor-container {width: 100%;}
.editor-container tiptap-editor {display: none;}
.editor-container textarea {height: initial;}
[data-loaded-editor] .editor-container tiptap-editor {display: block;}
+3 -1
View File
@@ -38,7 +38,8 @@ class editor extends wg
$editor = new h
(
setTag('tiptap-editor'),
setClass('form-control', 'p-0', 'h-auto'),
setClass('form-control', 'p-0'),
$this->prop('size') === 'full' ? setStyle('height', '100%') : setClass('h-auto'),
);
$props = $this->props->pick(array('createInput', 'uploadUrl', 'placeholder', 'fullscreenable', 'resizable', 'exposeEditor', 'size', 'hideMenubar', 'bubbleMenu', 'menubarMode', 'collaborative', 'hocuspocus', 'docName', 'username', 'userColor'));
foreach($props as $key => $value)
@@ -57,6 +58,7 @@ class editor extends wg
return div
(
setClass('editor-container'),
$props['size'] === 'full' ? setStyle('height', '100%') : setClass('h-auto'),
$editor,
textarea
(