|
138 | 138 | <h1 class="mb-4 title-flex"> |
139 | 139 | <!-- Logo --> |
140 | 140 | <span class="logo-wrapper" @click="showImageCropUploadMethod"> |
| 141 | + <button v-if="editMode" type="button" class="p-0 bg-transparent border-0 small-reset-btn reset-top-left" @click.stop="resetToDefaultImage"> |
| 142 | + <font-awesome-icon icon="times" class="text-danger" /> |
| 143 | + </button> |
141 | 144 | <img :src="logoURL" alt class="logo me-2" :class="logoClass" /> |
142 | 145 | <font-awesome-icon v-if="enableEditMode" class="icon-upload" icon="upload" /> |
143 | 146 | </span> |
@@ -962,6 +965,20 @@ export default { |
962 | 965 | } |
963 | 966 | }, |
964 | 967 |
|
| 968 | + /** |
| 969 | + * Reset logo image to default (public/icon.svg) |
| 970 | + * @returns {void} |
| 971 | + */ |
| 972 | + resetToDefaultImage() { |
| 973 | + if (! this.editMode) { |
| 974 | + return; |
| 975 | + } |
| 976 | +
|
| 977 | + this.imgDataUrl = "/icon.svg"; |
| 978 | + this.config.icon = this.imgDataUrl; |
| 979 | + toast.success(this.$t("imageResetConfirmation")); |
| 980 | + }, |
| 981 | +
|
965 | 982 | /** |
966 | 983 | * Create an incident for this status page |
967 | 984 | * @returns {void} |
@@ -1181,6 +1198,58 @@ footer { |
1181 | 1198 | cursor: pointer; |
1182 | 1199 | box-shadow: 0 15px 70px rgba(0, 0, 0, 0.9); |
1183 | 1200 | } |
| 1201 | +
|
| 1202 | + /* Reset button placed at top-left of the logo */ |
| 1203 | + .reset-top-left { |
| 1204 | + position: absolute; |
| 1205 | + top: 0; |
| 1206 | + left: -15px; |
| 1207 | + z-index: 2; |
| 1208 | + width: 20px; |
| 1209 | + height: 20px; |
| 1210 | + display: inline-flex; |
| 1211 | + align-items: center; |
| 1212 | + justify-content: center; |
| 1213 | + border-radius: 50%; |
| 1214 | + background: white; |
| 1215 | + border: none; |
| 1216 | + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); |
| 1217 | + cursor: pointer; |
| 1218 | + padding: 0; |
| 1219 | + transition: transform $easing-in 0.18s, box-shadow $easing-in 0.18s, background-color $easing-in 0.18s; |
| 1220 | + transform-origin: center; |
| 1221 | +
|
| 1222 | + &:hover { |
| 1223 | + background-color: rgba(0, 0, 0, 0.06); |
| 1224 | + transform: scale(1.18); |
| 1225 | + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); |
| 1226 | + } |
| 1227 | +
|
| 1228 | + &:hover ~ .icon-upload { |
| 1229 | + transform: none !important; |
| 1230 | + } |
| 1231 | + } |
| 1232 | +
|
| 1233 | + .small-reset-btn { |
| 1234 | + transition: transform $easing-in 0.18s, box-shadow $easing-in 0.18s, background-color $easing-in 0.18s; |
| 1235 | + font-size: 18px; |
| 1236 | + width: 18px; |
| 1237 | + height: 18px; |
| 1238 | + padding: 0; |
| 1239 | + display: inline-flex; |
| 1240 | + align-items: center; |
| 1241 | + justify-content: center; |
| 1242 | + border-radius: 50%; |
| 1243 | + background: transparent; |
| 1244 | + border: none; |
| 1245 | + cursor: pointer; |
| 1246 | +
|
| 1247 | + &:hover { |
| 1248 | + background-color: rgba(0, 0, 0, 0.04); |
| 1249 | + transform: scale(1.18); |
| 1250 | + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); |
| 1251 | + } |
| 1252 | + } |
1184 | 1253 | } |
1185 | 1254 |
|
1186 | 1255 | .logo { |
|
0 commit comments