Revise Remember Me checkbox appearance

Use a generic checkbox instead of a switch — it's more familiar and accessible.

Signed-off-by: Toby Zerner <toby.zerner@gmail.com>
This commit is contained in:
Toby Zerner 2017-07-08 22:25:24 +09:30
parent d87aa89dff
commit edf693bde1
2 changed files with 21 additions and 20 deletions

View File

@ -23869,10 +23869,10 @@ System.register('flarum/components/LogInButtons', ['flarum/Component', 'flarum/u
});;
'use strict';
System.register('flarum/components/LogInModal', ['flarum/components/Modal', 'flarum/components/ForgotPasswordModal', 'flarum/components/SignUpModal', 'flarum/components/Alert', 'flarum/components/Button', 'flarum/components/LogInButtons', 'flarum/components/Switch', 'flarum/utils/extractText'], function (_export, _context) {
System.register('flarum/components/LogInModal', ['flarum/components/Modal', 'flarum/components/ForgotPasswordModal', 'flarum/components/SignUpModal', 'flarum/components/Alert', 'flarum/components/Button', 'flarum/components/LogInButtons', 'flarum/utils/extractText'], function (_export, _context) {
"use strict";
var Modal, ForgotPasswordModal, SignUpModal, Alert, Button, LogInButtons, Switch, extractText, LogInModal;
var Modal, ForgotPasswordModal, SignUpModal, Alert, Button, LogInButtons, extractText, LogInModal;
return {
setters: [function (_flarumComponentsModal) {
Modal = _flarumComponentsModal.default;
@ -23886,8 +23886,6 @@ System.register('flarum/components/LogInModal', ['flarum/components/Modal', 'fla
Button = _flarumComponentsButton.default;
}, function (_flarumComponentsLogInButtons) {
LogInButtons = _flarumComponentsLogInButtons.default;
}, function (_flarumComponentsSwitch) {
Switch = _flarumComponentsSwitch.default;
}, function (_flarumUtilsExtractText) {
extractText = _flarumUtilsExtractText.default;
}],
@ -23924,7 +23922,7 @@ System.register('flarum/components/LogInModal', ['flarum/components/Modal', 'fla
*
* @type {Function}
*/
this.remember = m.prop(this.props.remember && true);
this.remember = m.prop(!!this.props.remember);
}
}, {
key: 'className',
@ -23963,12 +23961,16 @@ System.register('flarum/components/LogInModal', ['flarum/components/Modal', 'fla
m(
'div',
{ className: 'Form-group' },
Switch.component({
children: app.translator.trans('core.forum.log_in.remember_me_label'),
disabled: this.loading,
onchange: this.remember,
state: this.remember()
})
m(
'div',
null,
m(
'label',
{ className: 'checkbox' },
m('input', { type: 'checkbox', bidi: this.remember, disabled: this.loading }),
app.translator.trans('core.forum.log_in.remember_me_label')
)
)
),
m(
'div',

View File

@ -4,7 +4,6 @@ import SignUpModal from 'flarum/components/SignUpModal';
import Alert from 'flarum/components/Alert';
import Button from 'flarum/components/Button';
import LogInButtons from 'flarum/components/LogInButtons';
import Switch from 'flarum/components/Switch';
import extractText from 'flarum/utils/extractText';
/**
@ -38,7 +37,7 @@ export default class LogInModal extends Modal {
*
* @type {Function}
*/
this.remember = m.prop(this.props.remember && true);
this.remember = m.prop(!!this.props.remember);
}
className() {
@ -66,14 +65,14 @@ export default class LogInModal extends Modal {
bidi={this.password}
disabled={this.loading} />
</div>
<div className="Form-group">
{Switch.component({
children: app.translator.trans('core.forum.log_in.remember_me_label'),
disabled: this.loading,
onchange: this.remember,
state: this.remember()
})}
<div>
<label className="checkbox">
<input type="checkbox" bidi={this.remember} disabled={this.loading} />
{app.translator.trans('core.forum.log_in.remember_me_label')}
</label>
</div>
</div>
<div className="Form-group">