Fix missing button in forms

This commit is contained in:
yflory 2022-12-07 17:42:44 +01:00
parent c074eab7b7
commit f0bc1ef07a
1 changed files with 10 additions and 8 deletions

View File

@ -3995,6 +3995,15 @@ define([
var responseMsg = h('div.cp-form-response-msg-container');
var $responseMsg = $(responseMsg).appendTo($container);
var refreshResponse = function () {
var text = Messages.form_addMsg;
var btn = h('button.btn.btn-secondary.cp-form-response-button', text);
$(btn).click(function () {
if (!APP.responseDiv) { APP.getResponseMsgEditor(true); }
$responseMsg.append(APP.responseDiv);
$(btn).hide();
}).hide();
$responseMsg.append(btn);
if (content.answers.msg || APP.responseDiv) {
if (!APP.responseDiv) { APP.getResponseMsgEditor(); }
$responseMsg.append(APP.responseDiv);
@ -4010,14 +4019,7 @@ define([
editor.focus();
return;
}
var text = Messages.form_addMsg;
var btn = h('button.btn.btn-secondary.cp-form-response-button', text);
$(btn).click(function () {
if (!APP.responseDiv) { APP.getResponseMsgEditor(true); }
$responseMsg.append(APP.responseDiv);
$(btn).hide();
});
$responseMsg.append(btn);
$(btn).show();
};
refreshResponse();
}