Skip to content

Commit

Permalink
Fix: Ck-Editor plugin doesn't work in panel dynamic #251
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Apr 27, 2021
1 parent 04b3dea commit 2f41e8a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ck-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function init(Survey) {
});
},
afterRender: function (question, el) {
var name = question.name;
var name = question.inputId;
CKEDITOR.editorConfig = function (config) {
config.language = "es";
config.height = question.height;
Expand Down Expand Up @@ -59,18 +59,19 @@ function init(Survey) {
},
willUnmount: function (question, el) {
question.readOnlyChangedCallback = null;
CKEDITOR.instances[question.name].destroy(false);
CKEDITOR.instances[question.inputId].destroy(false);
},
pdfRender: function (survey, options) {
if (options.question.getType() === "editor") {
const loc = new Survey.LocalizableString(survey, true);
loc.text = options.question.value || options.question.defaultValue;
options.question["locHtml"] = loc;
if (options.question.renderAs === "standard" ||
options.question.renderAs === "image") {
if (
options.question.renderAs === "standard" ||
options.question.renderAs === "image"
) {
options.question["renderAs"] = options.question.renderAs;
}
else options.question["renderAs"] = "auto";
} else options.question["renderAs"] = "auto";
const flatHtml = options.repository.create(
survey,
options.question,
Expand Down

0 comments on commit 2f41e8a

Please sign in to comment.