upload widget: Rename image upload widget delete text CSS class.

Previously, image upload widget delete text CSS class name was
`settings-page-delete-text`.
We can change the CSS class name to `image-delete-text`
so that the name can be more generic.
This commit is contained in:
jagansivam28 2020-07-16 00:44:31 +05:30 committed by Tim Abbott
parent 90cb72b103
commit ad0ff10598
3 changed files with 9 additions and 10 deletions

View File

@ -44,20 +44,19 @@ exports.build_user_avatar_widget = function (upload_function) {
return $("#user-avatar-upload-widget .image_file_input").expectOne();
};
if (page_params.avatar_source === 'G') {
if (page_params.avatar_source === "G") {
$("#user-avatar-upload-widget .image-delete-button").hide();
$("#user-avatar-source").show();
} else {
$("#user-avatar-source").hide();
}
$("#user-avatar-upload-widget .image-delete-button").on('click keydown', (e) => {
$("#user-avatar-upload-widget .image-delete-button").on("click keydown", (e) => {
e.preventDefault();
e.stopPropagation();
channel.del({
url: "/json/users/me/avatar",
success () {
success() {
$("#user-avatar-upload-widget .image-delete-button").hide();
$("#user-avatar-source").show();
// Need to clear input because of a small edge case

View File

@ -43,11 +43,11 @@
visibility: hidden;
}
.image-delete-button:hover ~ .settings-page-delete-text {
.image-delete-button:hover ~ .image-delete-text {
visibility: visible;
}
.settings-page-delete-text {
.image-delete-text {
color: hsl(0, 0%, 100%);
font-size: 0.85rem;
position: absolute;
@ -126,7 +126,7 @@
font-size: 3rem;
}
.settings-page-delete-text {
.image-delete-text {
top: 90px;
right: 40px;
}
@ -168,7 +168,7 @@
border-radius: 5px;
box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
.settings-page-delete-text {
.image-delete-text {
top: 40px;
right: 18px;
}
@ -201,7 +201,7 @@
margin: 0px 80px 0px 20px;
.settings-page-upload-text,
.settings-page-delete-text {
.image-delete-text {
top: 17px;
right: 80px;
}

View File

@ -5,7 +5,7 @@
<span class="image-delete-button" aria-label="{{ delete_text }}" role="button" tabindex="0">
&times;
</span>
<span class="settings-page-delete-text" aria-label="{{ delete_text }}" tabindex="0">
<span class="image-delete-text" aria-label="{{ delete_text }}" tabindex="0">
{{ delete_text }}
</span>
<span class="settings-page-upload-text" aria-label="{{ upload_text }}" role="button" tabindex="0">