Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion assets/js/app/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ $(document).ready(function () {
/*
** Copy text to clipboard. Used in filemanager actions.
*/
new ClipboardJS('*[data-clipboard-text]');
const clipboard = new ClipboardJS('*[data-clipboard-text]');
clipboard.on('success', function (event) {
event.clearSelection();
});
/* End of copy text to clipboard */

/*
Expand Down
50 changes: 16 additions & 34 deletions assets/js/app/editor/Components/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
:checked="value"
type="checkbox"
:readonly="readonly"
@change="liveValue = $event.target.checked"
@change="liveValue = ($event.target as HTMLInputElement).checked"
/>
<label class="custom-control-label form-label" :for="name">{{ label }}</label>
<label class="custom-control-label form-label" :for="id">{{ label }}</label>

<!-- This hidden input is actually what gets submitted. It submits "true" when checked, and "false" when not checked -->
<!-- It exists because we need an "unchecked" value submitted. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox -->
Expand All @@ -19,36 +19,18 @@
</div>
</template>

<script>
export default {
name: 'EditorCheckbox',
props: {
value: {
type: Boolean,
},
name: {
type: String,
},
id: {
type: String,
},
required: {
type: Boolean,
},
readonly: {
type: Boolean,
},
label: {
type: String,
},
mode: {
type: String,
},
},
data() {
return {
liveValue: this.value,
};
},
};
<script setup lang="ts">
import { ref } from 'vue';

const props = defineProps<{
value?: boolean;
name?: string;
id?: string;
required?: boolean;
readonly?: boolean;
label?: string;
mode?: string;
}>();

const liveValue = ref(props.value);
</script>
Loading
Loading