mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 07:34:18 +08:00
FIX: Enter submits form for hyperlink insert modal (#9190)
This commit is contained in:
parent
d2bb127e2c
commit
8d90134d0b
|
@ -1,42 +1,44 @@
|
|||
{{#d-modal-body title="composer.link_dialog_title" class="insert-link"}}
|
||||
<div class="inputs">
|
||||
{{text-field
|
||||
value=linkUrl
|
||||
placeholderKey="composer.link_url_placeholder"
|
||||
class="link-url"
|
||||
key-up=(action "search")
|
||||
}}
|
||||
{{#if searchLoading}}
|
||||
{{loading-spinner}}
|
||||
{{/if}}
|
||||
{{#if searchResults}}
|
||||
<div class="internal-link-results">
|
||||
{{#each searchResults as |result|}}
|
||||
<a
|
||||
class="search-link"
|
||||
href={{result.url}}
|
||||
onclick={{action "linkClick"}}
|
||||
data-title={{result.title}}>
|
||||
{{topic-status topic=result disableActions=true}}
|
||||
{{replace-emoji result.fancy_title}}
|
||||
<div class="search-category">
|
||||
{{#if result.category.parentCategory}}
|
||||
{{category-link result.category.parentCategory}}
|
||||
{{/if}}
|
||||
{{category-link result.category hideParent=true}}
|
||||
{{discourse-tags result}}
|
||||
</div>
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="inputs">
|
||||
{{text-field value=linkText placeholderKey="composer.link_optional_text" class="link-text"}}
|
||||
</div>
|
||||
{{/d-modal-body}}
|
||||
<form {{action "ok" on="submit"}}>
|
||||
{{#d-modal-body title="composer.link_dialog_title" class="insert-link"}}
|
||||
<div class="inputs">
|
||||
{{text-field
|
||||
value=linkUrl
|
||||
placeholderKey="composer.link_url_placeholder"
|
||||
class="link-url"
|
||||
key-up=(action "search")
|
||||
}}
|
||||
{{#if searchLoading}}
|
||||
{{loading-spinner}}
|
||||
{{/if}}
|
||||
{{#if searchResults}}
|
||||
<div class="internal-link-results">
|
||||
{{#each searchResults as |result|}}
|
||||
<a
|
||||
class="search-link"
|
||||
href={{result.url}}
|
||||
onclick={{action "linkClick"}}
|
||||
data-title={{result.title}}>
|
||||
{{topic-status topic=result disableActions=true}}
|
||||
{{replace-emoji result.fancy_title}}
|
||||
<div class="search-category">
|
||||
{{#if result.category.parentCategory}}
|
||||
{{category-link result.category.parentCategory}}
|
||||
{{/if}}
|
||||
{{category-link result.category hideParent=true}}
|
||||
{{discourse-tags result}}
|
||||
</div>
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="inputs">
|
||||
{{text-field value=linkText placeholderKey="composer.link_optional_text" class="link-text"}}
|
||||
</div>
|
||||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
{{d-button class="btn-primary" label="composer.modal_ok" action=(action "ok")}}
|
||||
{{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{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")}}
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue
Block a user