Skip to content

Commit a8b2723

Browse files
authored
center the "edit start time" button on the screen (#166)
frontend development is so annoyingly hard sometimes this also clears "is-invalid" styling on an element when "is-valid" styling is added
1 parent d0f157c commit a8b2723

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

web/static/ims.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ export function unhide(selector) {
278278
}
279279
// Add an error indication to a control
280280
export function controlHasError(element) {
281+
element.classList.remove("is-valid");
281282
element.classList.add("is-invalid");
282283
}
283284
// Add a success indication to a control
284285
export function controlHasSuccess(element, clearTimeout) {
286+
element.classList.remove("is-invalid");
285287
element.classList.add("is-valid");
286288
if (clearTimeout != null) {
287289
setTimeout(() => {

web/template/incident.templ

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ templ Incident(deployment string) {
102102
<label class="control-label input-group-text" for="started_datetime">Created</label>
103103
<span class="form-control form-control-static align-middle d-flex justify-content-between">
104104
<span id="started_datetime"></span>
105-
<svg id="override_started_button" fill="currentColor" class="bi align-middle show-pointer">
106-
<use href="#pencil-square" />
107-
</svg>
105+
<span class="show-pointer">
106+
<svg id="override_started_button" fill="currentColor" class="bi align-middle">
107+
<use href="#pencil-square" />
108+
</svg>
109+
</span>
108110
</span>
109111
</div>
110112
</div>

web/template/incident_templ.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/typescript/ims.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,14 @@ export function unhide(selector: string): void {
316316

317317
// Add an error indication to a control
318318
export function controlHasError(element: HTMLElement) {
319+
element.classList.remove("is-valid");
319320
element.classList.add("is-invalid");
320321
}
321322

322323

323324
// Add a success indication to a control
324325
export function controlHasSuccess(element: HTMLElement, clearTimeout: number) {
326+
element.classList.remove("is-invalid");
325327
element.classList.add("is-valid");
326328
if (clearTimeout != null) {
327329
setTimeout(()=>{

0 commit comments

Comments
 (0)