mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
FIX: focusing input displayed after clicking on a link more reliable
This commit is contained in:
parent
4a9dadb646
commit
4e0c06a0b1
@ -0,0 +1,15 @@
|
||||
export default Ember.Component.extend({
|
||||
showInput: false,
|
||||
|
||||
click() {
|
||||
this.get("onClick")();
|
||||
|
||||
Ember.run.schedule("afterRender", () => {
|
||||
this.$()
|
||||
.find("input")
|
||||
.focus();
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
{{#if showInput}}
|
||||
{{yield}}
|
||||
{{else}}
|
||||
<a href>{{i18n key}}</a>
|
||||
{{/if}}
|
@ -24,11 +24,9 @@
|
||||
{{/unless}}
|
||||
|
||||
{{#if canEdit}}
|
||||
{{#if showEditReason}}
|
||||
{{text-field autofocus="true" value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}}
|
||||
{{else}}
|
||||
<a {{action "displayEditReason"}} class="display-edit-reason">{{i18n 'composer.show_edit_reason'}}</a>
|
||||
{{/if}}
|
||||
{{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason key="composer.show_edit_reason" class="display-edit-reason"}}
|
||||
{{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}}
|
||||
{{/link-to-input}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{composer-toggles composeState=model.composeState
|
||||
|
@ -157,6 +157,10 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.display-edit-reason {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#edit-reason {
|
||||
margin: 4px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user