From 396565aa59ded3c530b78de848a7458d75fe39fe Mon Sep 17 00:00:00 2001
From: Nils <695449+poldixd@users.noreply.github.com>
Date: Mon, 13 Nov 2023 12:24:56 +0100
Subject: [PATCH 1/2] Added $getMaxHeight() and $getMinHeight() to the disabled
view
---
resources/views/tiny-editor.blade.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/resources/views/tiny-editor.blade.php b/resources/views/tiny-editor.blade.php
index e985330..ba3d15f 100644
--- a/resources/views/tiny-editor.blade.php
+++ b/resources/views/tiny-editor.blade.php
@@ -123,7 +123,11 @@ class="overflow-hidden"
@else
$getMaxHeight() > 0,
+ 'min-height: '.$getMinHeight().'px' => $getMinHeight() > 0,
+ ])
+ class="block w-full max-w-none rounded-lg border border-gray-300 bg-white p-3 opacity-70 shadow-sm transition duration-75 prose dark:prose-invert dark:border-gray-600 dark:bg-gray-700 dark:text-white overflow-y-auto"
>
@endunless
From 5d19c2ef650f1a4da34a573ff42c87b207c7a366 Mon Sep 17 00:00:00 2001
From: Nils Poltmann
Date: Mon, 13 Nov 2023 13:45:16 +0100
Subject: [PATCH 2/2] Added $previewMaxHeight and $previewMinHeight
---
resources/views/tiny-editor.blade.php | 4 ++--
src/Components/TinyEditor.php | 28 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/resources/views/tiny-editor.blade.php b/resources/views/tiny-editor.blade.php
index ba3d15f..0f91b1e 100644
--- a/resources/views/tiny-editor.blade.php
+++ b/resources/views/tiny-editor.blade.php
@@ -124,8 +124,8 @@ class="overflow-hidden"
$getMaxHeight() > 0,
- 'min-height: '.$getMinHeight().'px' => $getMinHeight() > 0,
+ 'max-height: '.$getPreviewMaxHeight().'px' => $getPreviewMaxHeight() > 0,
+ 'min-height: '.$getPreviewMinHeight().'px' => $getPreviewMinHeight() > 0,
])
class="block w-full max-w-none rounded-lg border border-gray-300 bg-white p-3 opacity-70 shadow-sm transition duration-75 prose dark:prose-invert dark:border-gray-600 dark:bg-gray-700 dark:text-white overflow-y-auto"
>
diff --git a/src/Components/TinyEditor.php b/src/Components/TinyEditor.php
index ebe82c9..33b39ac 100644
--- a/src/Components/TinyEditor.php
+++ b/src/Components/TinyEditor.php
@@ -22,6 +22,10 @@ class TinyEditor extends Field implements Contracts\CanBeLengthConstrained, Cont
protected int $minHeight = 0;
+ protected int $previewMaxHeight = 0;
+
+ protected int $previewMinHeight = 0;
+
// TinyMCE var: external_plugins
protected array $externalPlugins;
@@ -73,6 +77,16 @@ public function getMinHeight(): int
return $this->minHeight;
}
+ public function getPreviewMaxHeight(): int
+ {
+ return $this->previewMaxHeight;
+ }
+
+ public function getPreviewMinHeight(): int
+ {
+ return $this->previewMinHeight;
+ }
+
public function getFileAttachmentsDirectory(): ?string
{
return filled($directory = $this->evaluate($this->fileAttachmentsDirectory)) ? $directory : config('filament-forms-tinyeditor.profiles.'.$this->profile.'.upload_directory');
@@ -257,6 +271,20 @@ public function minHeight(int $minHeight): static
return $this;
}
+ public function previewMaxHeight(int $previewMaxHeight): static
+ {
+ $this->previewMaxHeight = $previewMaxHeight;
+
+ return $this;
+ }
+
+ public function previewMinHeight(int $previewMinHeight): static
+ {
+ $this->previewMinHeight = $previewMinHeight;
+
+ return $this;
+ }
+
public function isSimple(): bool
{
return (bool) $this->evaluate($this->isSimple);