Skip to content

Commit

Permalink
Disable submit until ready
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Oct 21, 2023
1 parent 0940736 commit 25e96dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/realtime-compiler/resources/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<a href="https://github.com/hydephp/realtime-compiler/issues/new?{{ http_build_query(['title' => 'Feedback on the dashboard create page modal', 'body' => 'Write something nice!']) }}" class="btn btn-sm btn-outline-success me-auto" title="This is a new feature, we'd love your feedback!" target="_blank" rel="noopener">Send feedback</a>

<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-sm btn-primary">Create page</button>
<button type="submit" class="btn btn-sm btn-primary" id="createPageButton" title="Please select a page type first" disabled>Create page</button>
</div>
<script>
// Focus when modal is opened
Expand All @@ -158,8 +158,8 @@
const contentInputLabel = document.getElementById('contentInputLabel');
const contentInput = document.getElementById('contentInput');
const pageTypeSelection = document.getElementById('pageTypeSelection');
const createPageButton = document.getElementById('createPageButton');
const baseInfo = document.getElementById('baseInfo');
const createsPost = document.getElementById('createsPost');
Expand All @@ -175,6 +175,9 @@
contentInputLabel.innerText = contentInputLabelDefault;
contentInput.placeholder = contentInputPlaceholderDefault;
createPageButton.disabled = false;
createPageButton.title = '';
baseInfo.style.display = 'none';
createsPost.style.display = 'none';
Expand Down

0 comments on commit 25e96dd

Please sign in to comment.