]> BookStack Code Mirror - bookstack/commitdiff
dropzone: Addressed existing todos, cleaned attachment ux
authorDan Brown <redacted>
Wed, 26 Apr 2023 22:31:38 +0000 (23:31 +0100)
committerDan Brown <redacted>
Wed, 26 Apr 2023 22:31:38 +0000 (23:31 +0100)
Updated dom layout of attahcments to prevent nested dropzones (No issue
but potential to be one) and updated edit form dropzone handling so the
dropzone item card was not as distracting.

app/Http/Controllers/Images/GalleryImageController.php
resources/js/components/editor-toolbox.js
resources/views/attachments/manager-edit-form.blade.php
resources/views/attachments/manager-link-form.blade.php
resources/views/attachments/manager.blade.php
resources/views/form/simple-dropzone.blade.php

index 99226e5e9178d1e5a2d7554b449206b1cc563e17..c01eccfee30193a5fc95f85f5a2630e190846569 100644 (file)
@@ -48,7 +48,6 @@ class GalleryImageController extends Controller
                 'file' => $this->getImageValidationRules(),
             ]);
         } catch (ValidationException $exception) {
-            // TODO - Check potential other upload locations?
             return $this->jsonError(implode("\n", $exception->errors()['file']));
         }
 
index 1f1fce9dcacb6978ecd68fe350d7368baabf5faa..4d3c0ae75d22177e0362c21b2b2b7f971e1af2ac 100644 (file)
@@ -13,10 +13,6 @@ export class EditorToolbox extends Component {
 
         // Set the first tab as active on load
         this.setActiveTab(this.contentElements[0].dataset.tabContent);
-
-        setTimeout(() => {
-            this.setActiveTab('files', true);
-        }, 500);
     }
 
     setupListeners() {
index 9422a0752642c58972833f32f0b49db284c8482c..cfb514df0bd2b435c0d32a08e6ce7a5d119cea2f 100644 (file)
@@ -1,7 +1,7 @@
 <div component="ajax-form"
      option:ajax-form:url="/attachments/{{ $attachment->id }}"
      option:ajax-form:method="put"
-     option:ajax-form:response-container=".attachment-edit-container"
+     option:ajax-form:response-container="#edit-form-container"
      option:ajax-form:success-message="{{ trans('entities.attachments_updated_success') }}">
     <h5>{{ trans('entities.attachments_edit_file') }}</h5>
 
index e9ec2d6dc9cd40f4edf285cb3b8dd1b7edbc6f85..a2fba83eb48e28981528d084eb990020ed991c69 100644 (file)
@@ -4,7 +4,7 @@
 <div component="ajax-form"
      option:ajax-form:url="/attachments/link"
      option:ajax-form:method="post"
-     option:ajax-form:response-container=".link-form-container"
+     option:ajax-form:response-container="#link-form-container"
      option:ajax-form:success-message="{{ trans('entities.attachments_link_attached') }}">
     <input type="hidden" name="attachment_link_uploaded_to" value="{{ $pageId }}">
     <p class="text-muted small">{{ trans('entities.attachments_explain_link') }}</p>
index 4eeee24bb850aed44e0064b1bc54b476a17d4d94..4526172d4db63b2d62ca7a362bfa4ea131d4b2aa 100644 (file)
             </div>
 
         </div>
+    </div>
 
-        <div refs="attachments@links-container" hidden class="link-form-container">
-            @include('attachments.manager-link-form', ['pageId' => $page->id])
-        </div>
+    <div id="link-form-container" refs="attachments@links-container" hidden class="px-l">
+        @include('attachments.manager-link-form', ['pageId' => $page->id])
+    </div>
 
-        <div refs="attachments@edit-container" hidden class="attachment-edit-container"></div>
+    <div id="edit-form-container" refs="attachments@edit-container" hidden class="px-l"></div>
 
-    </div>
 </div>
\ No newline at end of file
index e274949eadba32452c969b0a3f63852f2e8bb60d..cfd3d905d2739d9b8d6d4592e7b0060fa42934b8 100644 (file)
@@ -12,7 +12,7 @@
      option:dropzone:zone-text="{{ trans('entities.attachments_dropzone') }}"
      option:dropzone:file-accept="*"
      class="relative">
-    <div refs="dropzone@status-area" class="fixed top-right px-m py-m"></div>
+    <div refs="dropzone@status-area"></div>
     <button type="button"
             refs="dropzone@select-button dropzone@drop-target"
             class="dropzone-landing-area text-center">