mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -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}}
|
{{/unless}}
|
||||||
|
|
||||||
{{#if canEdit}}
|
{{#if canEdit}}
|
||||||
{{#if showEditReason}}
|
{{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason key="composer.show_edit_reason" class="display-edit-reason"}}
|
||||||
{{text-field autofocus="true" value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}}
|
{{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}}
|
||||||
{{else}}
|
{{/link-to-input}}
|
||||||
<a {{action "displayEditReason"}} class="display-edit-reason">{{i18n 'composer.show_edit_reason'}}</a>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{composer-toggles composeState=model.composeState
|
{{composer-toggles composeState=model.composeState
|
||||||
|
@ -157,6 +157,10 @@
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.display-edit-reason {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
#edit-reason {
|
#edit-reason {
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user