Skip to content

Commit

Permalink
Fix UI issue with markdown editor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Sep 28, 2023
1 parent e4ed076 commit 2682642
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
9 changes: 8 additions & 1 deletion app/admin/formwidgets/MediaFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ public function onAddAttachment()
));
}

$items = post('items');
$items = $this->validate(request()->input(), [
'items' => ['required', 'array'],
'items.*.name' => ['required', 'string'],
'items.*.path' => ['required', 'string'],
]);

if (!is_array($items))
throw new ApplicationException(lang('main::lang.media_manager.alert_select_item_to_attach'));

Expand All @@ -248,6 +253,8 @@ public function onAddAttachment()

$manager = MediaLibrary::instance();
foreach ($items as &$item) {
$item['path'] = strip_tags($item['path']);

$media = $model->newMediaInstance();
$media->addFromRaw(
$manager->get(array_get($item, 'path'), true),
Expand Down
19 changes: 13 additions & 6 deletions app/admin/formwidgets/markdowneditor/assets/css/markdowneditor.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
.editor-toolbar {
border-color: var(--bs-gray-300);
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: var(--bs-gray-300);
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}

.editor-toolbar button.table {
width: 30px;
}

.editor-toolbar button.active,
.editor-toolbar button:hover {
border-color: var(--bs-gray-300);
border-color: var(--bs-gray-300);
}

.field-markdowneditor .CodeMirror {
border: 1px solid var(--bs-gray-300);
border: 1px solid var(--bs-gray-300);
}

.editor-toolbar.fullscreen,
.field-markdowneditor .CodeMirror-fullscreen,
.editor-preview-side {
z-index: 1040;
z-index: 1040;
}

0 comments on commit 2682642

Please sign in to comment.