mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: better help text for composer collapse / discard
also: warn on collapsed close if you are to discard content
This commit is contained in:
parent
0d34caff85
commit
bf1f6c7fe4
@ -3,6 +3,14 @@ import computed from 'ember-addons/ember-computed-decorators';
|
|||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: '',
|
tagName: '',
|
||||||
|
|
||||||
|
@computed('composeState')
|
||||||
|
title(composeState) {
|
||||||
|
if (composeState === "draft" || composeState === "saving") {
|
||||||
|
return "composer.abandon";
|
||||||
|
}
|
||||||
|
return "composer.collapse";
|
||||||
|
},
|
||||||
|
|
||||||
@computed('composeState')
|
@computed('composeState')
|
||||||
toggleIcon(composeState) {
|
toggleIcon(composeState) {
|
||||||
if (composeState === "draft" || composeState === "saving") {
|
if (composeState === "draft" || composeState === "saving") {
|
||||||
|
@ -303,15 +303,18 @@ export default Ember.Controller.extend({
|
|||||||
// Toggle the reply view
|
// Toggle the reply view
|
||||||
toggle() {
|
toggle() {
|
||||||
this.closeAutocomplete();
|
this.closeAutocomplete();
|
||||||
if (this.get('model.composeState') === Composer.OPEN) {
|
|
||||||
if (Ember.isEmpty(this.get('model.reply')) && Ember.isEmpty(this.get('model.title'))) {
|
if (Ember.isEmpty(this.get('model.reply')) && Ember.isEmpty(this.get('model.title'))) {
|
||||||
this.close();
|
this.close();
|
||||||
} else {
|
} else {
|
||||||
|
if (this.get('model.composeState') === Composer.OPEN) {
|
||||||
this.shrink();
|
this.shrink();
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.close();
|
debugger;
|
||||||
|
this.cancelComposer();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,5 +10,5 @@
|
|||||||
class="toggler"
|
class="toggler"
|
||||||
icon=toggleIcon
|
icon=toggleIcon
|
||||||
action=toggleComposer
|
action=toggleComposer
|
||||||
title='composer.toggler'}}
|
title=title}}
|
||||||
</div>
|
</div>
|
@ -24,13 +24,9 @@
|
|||||||
addLinkLookup="addLinkLookup"}}
|
addLinkLookup="addLinkLookup"}}
|
||||||
|
|
||||||
{{#if model.viewOpen}}
|
{{#if model.viewOpen}}
|
||||||
|
|
||||||
<div class="reply-area {{if canEditTags 'with-tags'}}">
|
<div class="reply-area {{if canEditTags 'with-tags'}}">
|
||||||
|
|
||||||
<div class='composer-fields'>
|
<div class='composer-fields'>
|
||||||
|
|
||||||
{{plugin-outlet name="composer-open" args=(hash model=model)}}
|
{{plugin-outlet name="composer-open" args=(hash model=model)}}
|
||||||
|
|
||||||
<div class='reply-to'>
|
<div class='reply-to'>
|
||||||
<div class="reply-details">
|
<div class="reply-details">
|
||||||
{{{model.actionTitle}}}
|
{{{model.actionTitle}}}
|
||||||
@ -119,7 +115,6 @@
|
|||||||
<div class='submit-panel'>
|
<div class='submit-panel'>
|
||||||
{{plugin-outlet name="composer-fields-below" args=(hash model=model)}}
|
{{plugin-outlet name="composer-fields-below" args=(hash model=model)}}
|
||||||
|
|
||||||
|
|
||||||
<div class='save-or-cancel'>
|
<div class='save-or-cancel'>
|
||||||
{{composer-save-button action=(action "save")
|
{{composer-save-button action=(action "save")
|
||||||
icon=model.saveIcon
|
icon=model.saveIcon
|
||||||
|
@ -1275,7 +1275,8 @@ en:
|
|||||||
ulist_title: "Bulleted List"
|
ulist_title: "Bulleted List"
|
||||||
list_item: "List item"
|
list_item: "List item"
|
||||||
help: "Markdown Editing Help"
|
help: "Markdown Editing Help"
|
||||||
toggler: "hide or show the composer panel"
|
collapse: "minimize the composer panel"
|
||||||
|
abandon: "close composer and discard draft"
|
||||||
modal_ok: "OK"
|
modal_ok: "OK"
|
||||||
modal_cancel: "Cancel"
|
modal_cancel: "Cancel"
|
||||||
cant_send_pm: "Sorry, you can't send a message to %{username}."
|
cant_send_pm: "Sorry, you can't send a message to %{username}."
|
||||||
|
Loading…
Reference in New Issue
Block a user