widgets: update rich text on live update (#75274)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
60b2ec98ef
commit
96810d58bb
|
@ -623,7 +623,9 @@ $(function() {
|
|||
} else {
|
||||
if ($(widget).is('.widget-prefilled') || $(widget).is('.widget-readonly') || data.modified_field == 'user') {
|
||||
// replace text input value
|
||||
$(widget).find('input[type=text], input[type=tel], input[type=numeric], input[type=email], input[type=date], textarea').val(value.content);
|
||||
const $text_inputs = $(widget).find('input[type=text], input[type=tel], input[type=numeric], input[type=email], input[type=date], textarea');
|
||||
$text_inputs.val(value.content)
|
||||
$text_inputs.each((_, el) => el.dispatchEvent(new Event('wcs:live-update')));
|
||||
if ($(widget).is('.DateWidget')) {
|
||||
// Set both hidden input for real value, and text input for
|
||||
// formatted date. This will also set the old date picker
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
<textarea style="width: 100%" id="form_{{widget.get_name_for_id}}" name="{{widget.name}}"
|
||||
{% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}" {% endfor %}
|
||||
{% if widget.live_condition_source %}data-godo-instant-update="true"{% endif %}
|
||||
data-godo-schema="{{widget.EDITION_MODE}}"> {{widget.value|default:""}}
|
||||
data-godo-schema="{{widget.EDITION_MODE}}"
|
||||
data-godo-update-event="wcs:live-update">
|
||||
{{widget.value|default:""}}
|
||||
</textarea>
|
||||
<script type="module" src="/static/xstatic/js/godo.js?{{version_hash}}"></script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue