mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-22 14:49:59 +08:00
Cleaned some form styling
Removed uppercasing of labels to make a little friendlier. Extracted out toggleswitch JS into own component. Improved basic code input for html-head-input area.
This commit is contained in:
@ -1,15 +1,4 @@
|
||||
<div toggle-switch="{{$name}}" class="toggle-switch @if($value) active @endif">
|
||||
<input type="hidden" name="{{$name}}" value="{{$value?'true':'false'}}"/>
|
||||
<div class="switch-handle"></div>
|
||||
</div>
|
||||
<script>
|
||||
(function() {
|
||||
var toggle = document.querySelector('[toggle-switch="{{$name}}"]');
|
||||
var toggleInput = toggle.querySelector('input');
|
||||
toggle.onclick = function(event) {
|
||||
var checked = toggleInput.value !== 'true';
|
||||
toggleInput.value = checked ? 'true' : 'false';
|
||||
checked ? toggle.classList.add('active') : toggle.classList.remove('active');
|
||||
};
|
||||
})()
|
||||
</script>
|
||||
</div>
|
Reference in New Issue
Block a user