Files
2026-09-15 10:35:56 +08:00

21 lines
623 B
PHTML

<script>
require(['jquery'], function ($) {
'use strict';
$(document).on('change', '.esun-blog-use-default input', function () {
var $checkbox = $(this),
$field = $($checkbox.attr('data-target')),
disabled = $checkbox.is(':checked'),
editor;
$field.prop('disabled', disabled);
if (window.tinyMCE && $field.attr('id')) {
editor = window.tinyMCE.get($field.attr('id'));
if (editor && editor.mode && editor.mode.set) {
editor.mode.set(disabled ? 'readonly' : 'design');
}
}
});
});
</script>