ShrinkVertically v1.6.2: move config auto-adjust dim into external JS (CSP blocks inline script)
This commit is contained in:
@@ -37,23 +37,5 @@
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Dim + disable the pixel-offset input while "Auto adjust" is checked (auto mode measures the height
|
||||
// live on the board, so the manual offset is inactive). Disabled inputs are not submitted; the
|
||||
// controller preserves the stored offset when it is absent, so the manual value is never lost.
|
||||
(function () {
|
||||
"use strict";
|
||||
var auto = document.getElementById("form-shrink_vertically_auto");
|
||||
var offset = document.getElementById("form-shrink_vertically_offset");
|
||||
if (! auto || ! offset) {
|
||||
return;
|
||||
}
|
||||
function sync() {
|
||||
offset.disabled = auto.checked;
|
||||
offset.style.opacity = auto.checked ? "0.4" : "";
|
||||
}
|
||||
auto.addEventListener("change", sync);
|
||||
sync();
|
||||
})();
|
||||
</script>
|
||||
<?php /* The "Auto adjust" checkbox dims/disables the offset input via Asset/js/shrink-vertically.js
|
||||
(loaded globally). An inline <script> here would be blocked by Kanboard's CSP. */ ?>
|
||||
|
||||
Reference in New Issue
Block a user