Skip to content

Commit 0e43cbb

Browse files
committed
add a bit of css to make editable backend titles obvious
1 parent 889b7e9 commit 0e43cbb

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/wwwroot/css/site.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ body {
158158
border: 1px solid #000000 !important;
159159
background-color: var(--green) !important;
160160
}
161+
.backend-toggle-switch {
162+
float: none !important;
163+
vertical-align: middle !important;
164+
}
165+
.backend-title-editable {
166+
border: 1px solid var(--shadow);
167+
border-radius: 0.5rem;
168+
background-color: var(--background);
169+
padding: 0.3rem;
170+
padding-bottom: 0.4rem;
171+
}
161172
.auto-slider-fade-contain {
162173
display: inline-block;
163174
width: calc(min(100%, 50rem) - 5rem - 2px);

src/wwwroot/js/genpage/backends.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function addBackendToHtml(backend, disable, spot = null) {
2929
togglerSpan.className = 'form-check form-switch display-inline-block';
3030
let toggleSwitch = document.createElement('input');
3131
toggleSwitch.type = 'checkbox';
32-
toggleSwitch.className = 'backend-toggle-switch form-check-input';
32+
toggleSwitch.className = 'form-check-input backend-toggle-switch';
3333
toggleSwitch.title = 'Enable/Disable backend';
3434
toggleSwitch.checked = backend.enabled;
3535
toggleSwitch.addEventListener('change', () => {
@@ -107,13 +107,15 @@ function addBackendToHtml(backend, disable, spot = null) {
107107
saveButton.style.display = 'inline-block';
108108
editButton.disabled = true;
109109
actualCardTitle.contentEditable = true;
110+
actualCardTitle.classList.add('backend-title-editable');
110111
for (let entry of cardBody.querySelectorAll('[data-name]')) {
111112
entry.disabled = false;
112113
}
113114
});
114115
saveButton.addEventListener('click', () => {
115116
saveButton.style.display = 'none';
116117
actualCardTitle.contentEditable = false;
118+
actualCardTitle.classList.remove('backend-title-editable');
117119
for (let entry of cardBody.querySelectorAll('[data-name]')) {
118120
let name = entry.dataset.name;
119121
let value = entry.type == 'checkbox' ? entry.checked : entry.value;

0 commit comments

Comments
 (0)