]> BookStack Code Mirror - bookstack/blobdiff - resources/views/components/toggle-switch.blade.php
Update settings.php
[bookstack] / resources / views / components / toggle-switch.blade.php
index ad54d5ab1f965eef8f435e66098c3abab5684f68..a5eec30051b32a9bcd9e983c0fd98a40c4356ca9 100644 (file)
@@ -1,15 +1,8 @@
-<div toggle-switch="{{$name}}" class="toggle-switch @if($value) active @endif">
+<label toggle-switch="{{$name}}" custom-checkbox class="toggle-switch">
     <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>
\ No newline at end of file
+    <input type="checkbox" @if($value) checked="checked" @endif>
+    <span tabindex="0" role="checkbox"
+          aria-checked="{{ $value ? 'true' : 'false' }}"
+          class="custom-checkbox text-primary">@icon('check')</span>
+    <span class="label">{{ $label }}</span>
+</label>
\ No newline at end of file