optimize 'hide help button' code
This commit is contained in:
parent
2bf2d506bf
commit
34126eb9e0
|
@ -6,6 +6,7 @@ import computed from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
offerHelp: null,
|
offerHelp: null,
|
||||||
|
helpSeen: false,
|
||||||
|
|
||||||
@computed('accountEmailOrUsername', 'disabled')
|
@computed('accountEmailOrUsername', 'disabled')
|
||||||
submitDisabled(accountEmailOrUsername, disabled) {
|
submitDisabled(accountEmailOrUsername, disabled) {
|
||||||
|
@ -59,8 +60,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
},
|
},
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
this.set('offerHelp', I18n.t('forgot_password.help'));
|
this.setProperties({ offerHelp: I18n.t('forgot_password.help'), helpSeen: true });
|
||||||
$('.forgot-password-help-btn').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
|
||||||
showCreateAccount: unlessReadOnly('handleShowCreateAccount', I18n.t("read_only_mode.login_disabled")),
|
showCreateAccount: unlessReadOnly('handleShowCreateAccount', I18n.t("read_only_mode.login_disabled")),
|
||||||
|
|
||||||
showForgotPassword() {
|
showForgotPassword() {
|
||||||
this.controllerFor('forgot-password').set('offerHelp', null);
|
this.controllerFor('forgot-password').setProperties({ offerHelp: null, helpSeen: false });
|
||||||
showModal('forgotPassword', { title: 'forgot_password.title' });
|
showModal('forgotPassword', { title: 'forgot_password.title' });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,11 @@
|
||||||
{{d-button class="btn-large btn-primary"
|
{{d-button class="btn-large btn-primary"
|
||||||
label="forgot_password.button_ok"
|
label="forgot_password.button_ok"
|
||||||
action="ok"}}
|
action="ok"}}
|
||||||
{{d-button class="btn-large forgot-password-help-btn"
|
{{#unless helpSeen}}
|
||||||
|
{{d-button class="btn-large"
|
||||||
label="forgot_password.button_help"
|
label="forgot_password.button_help"
|
||||||
action="help"}}
|
action="help"}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue