diff --git a/README.md b/README.md index 9920c43..2742e57 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Marksmith accepts a few configuration options. ### Field options -The field supports a few of the regular options like `disabled`, `placeholder`, `autofocus`, `style`, `class`, `data`, and `value`, but also a custom one. +The field supports a few of the regular options like `disabled`, `placeholder`, `autofocus`, `style`, `class`, `data`, `rows` and `value`, but also a custom one. `extra_preview_params` - Sends extra params to the preview renderer. diff --git a/app/models/marksmith/editor.rb b/app/models/marksmith/editor.rb index e48af3b..d78b905 100644 --- a/app/models/marksmith/editor.rb +++ b/app/models/marksmith/editor.rb @@ -13,7 +13,8 @@ class Marksmith::Editor :style, :gallery, :kwargs, - :id + :id, + :rows def initialize(name:, upload_url: nil, @@ -31,6 +32,7 @@ def initialize(name:, value: nil, id: "marksmith-instance-#{rand(1000..9999)}", gallery: {}, + rows: 11, **kwargs) @name = name @kwargs = kwargs @@ -50,6 +52,7 @@ def initialize(name:, @value = value @id = id @gallery = gallery + @rows = rows end def gallery_enabled diff --git a/app/views/marksmith/shared/_editor_pane.html.erb b/app/views/marksmith/shared/_editor_pane.html.erb index 4ed8abe..670a490 100644 --- a/app/views/marksmith/shared/_editor_pane.html.erb +++ b/app/views/marksmith/shared/_editor_pane.html.erb @@ -2,7 +2,7 @@ <%= text_area_tag editor.field_name, editor.value, id: editor.textarea_id, class: class_names( - "ms:flex ms:flex-1 ms:border-none ms:resize-none ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal ms:p-2 ms:text-sm ms:field-sizing-content ms:min-h-60", + "ms:flex ms:flex-1 ms:border-none ms:resize-none ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal ms:p-2 ms:text-sm ms:field-sizing-content", "ms:dark:bg-neutral-800 ms:dark:text-neutral-200", editor.classes ), @@ -14,7 +14,8 @@ disabled: editor.disabled, placeholder: editor.placeholder, autofocus: editor.autofocus, - style: editor.style + style: editor.style, + rows: editor.rows %> <% toolbar_button_classes = "ms:cursor-pointer ms:hover:bg-neutral-200 ms:px-1 ms:py-px ms:rounded ms:text-sm ms:dark:text-neutral-300 ms:dark:hover:bg-neutral-600" %>