FIX: Enter submits form for hyperlink insert modal (#9190)

This commit is contained in:
Mark VanLandingham 2020-03-12 09:36:45 -05:00 committed by GitHub
parent d2bb127e2c
commit 8d90134d0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 41 deletions

View File

@ -1,42 +1,44 @@
{{#d-modal-body title="composer.link_dialog_title" class="insert-link"}} <form {{action "ok" on="submit"}}>
<div class="inputs"> {{#d-modal-body title="composer.link_dialog_title" class="insert-link"}}
{{text-field <div class="inputs">
value=linkUrl {{text-field
placeholderKey="composer.link_url_placeholder" value=linkUrl
class="link-url" placeholderKey="composer.link_url_placeholder"
key-up=(action "search") class="link-url"
}} key-up=(action "search")
{{#if searchLoading}} }}
{{loading-spinner}} {{#if searchLoading}}
{{/if}} {{loading-spinner}}
{{#if searchResults}} {{/if}}
<div class="internal-link-results"> {{#if searchResults}}
{{#each searchResults as |result|}} <div class="internal-link-results">
<a {{#each searchResults as |result|}}
class="search-link" <a
href={{result.url}} class="search-link"
onclick={{action "linkClick"}} href={{result.url}}
data-title={{result.title}}> onclick={{action "linkClick"}}
{{topic-status topic=result disableActions=true}} data-title={{result.title}}>
{{replace-emoji result.fancy_title}} {{topic-status topic=result disableActions=true}}
<div class="search-category"> {{replace-emoji result.fancy_title}}
{{#if result.category.parentCategory}} <div class="search-category">
{{category-link result.category.parentCategory}} {{#if result.category.parentCategory}}
{{/if}} {{category-link result.category.parentCategory}}
{{category-link result.category hideParent=true}} {{/if}}
{{discourse-tags result}} {{category-link result.category hideParent=true}}
</div> {{discourse-tags result}}
</a> </div>
{{/each}} </a>
</div> {{/each}}
{{/if}} </div>
</div> {{/if}}
<div class="inputs"> </div>
{{text-field value=linkText placeholderKey="composer.link_optional_text" class="link-text"}} <div class="inputs">
</div> {{text-field value=linkText placeholderKey="composer.link_optional_text" class="link-text"}}
{{/d-modal-body}} </div>
{{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
{{d-button class="btn-primary" label="composer.modal_ok" action=(action "ok")}} {{d-button class="btn-primary" label="composer.modal_ok" action=(action "ok") type="submit"}}
{{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}} {{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}}
</div> </div>
</form>