2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

A11Y: Use button in d-modal-cancel component (#17938)

Fixes issue under User profile > Preferences > Security > Recently Used
devices > Cog icon. And cleans up the "reply where" modal as well.
This commit is contained in:
Penar Musaraj 2022-08-16 21:39:28 -04:00 committed by GitHub
parent 1c324aff98
commit c790b0305c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 26 deletions

View file

@ -912,8 +912,7 @@ export default Controller.extend({
let buttons = [ let buttons = [
{ {
label: I18n.t("composer.cancel"), label: I18n.t("composer.cancel"),
class: "d-modal-cancel", class: "btn-flat btn-text btn-reply-where-cancel",
link: true,
}, },
]; ];
@ -923,7 +922,7 @@ export default Controller.extend({
"<br/><div class='topic-title overflow-ellipsis'>" + "<br/><div class='topic-title overflow-ellipsis'>" +
currentTopic.get("fancyTitle") + currentTopic.get("fancyTitle") +
"</div>", "</div>",
class: "btn btn-reply-here", class: "btn-reply-here",
callback: () => { callback: () => {
composer.setProperties({ topic: currentTopic, post: null }); composer.setProperties({ topic: currentTopic, post: null });
this.save(true); this.save(true);

View file

@ -1 +1 @@
<a href {{action this.close}} class="d-modal-cancel">{{i18n "cancel"}}</a> <DButton @class="btn-flat d-modal-cancel" @action={{action this.close}} @translatedLabel={{i18n "cancel"}} />

View file

@ -286,37 +286,27 @@
font-size: $font-up-2; font-size: $font-up-2;
} }
.d-modal-cancel {
width: 100%;
margin: 0.5em 0;
}
.btn { .btn {
display: block; display: block;
text-align: left; text-align: left;
font-size: $font-up-1;
line-height: $line-height-medium;
margin-bottom: 0.75em; margin-bottom: 0.75em;
font-weight: bold;
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
&:first-of-type { &:first-of-type {
margin-top: 0.25em; margin-top: 0.25em;
} }
&.btn-reply-on-original,
&.btn-reply-here {
font-size: $font-up-1;
line-height: $line-height-medium;
font-weight: bold;
}
.topic-title { .topic-title {
font-weight: normal; font-weight: normal;
} }
} }
} }
.d-modal-cancel {
margin-left: 1em;
color: var(--primary-medium);
&:hover {
color: var(--danger);
}
}
.delete-user-modal { .delete-user-modal {
.modal-footer { .modal-footer {
.btn { .btn {

View file

@ -91,12 +91,6 @@
} }
} }
.feature-topic-modal {
.d-modal-cancel {
margin-left: 0;
}
}
.desktop-view .feature-topic-modal { .desktop-view .feature-topic-modal {
.pin-until { .pin-until {
position: relative; position: relative;