Hello,
Is it possible for the popupdescription field I added to appear in the translation tab, because by default the field does not appear.
It adds a popupdescription property as follows:
JavaScriptSerializer.addProperty("question", {
name: "popupdescription:text",
category: "general",
visibleIndex: 1
});
JavaScriptfunction createButtonForPopup(options, showPopup) { // Add a button;
let btn = document.createElement("button");
// Show button if popupDescription property is not empty
btn.style.visibility = !options.question.popupdescription
? "hidden"
: "";
btn.type = "button";
btn.className = "sd-btn sd-btn--action";
btn.style.position = "relative";
btn.style.marginLeft = "20px";
btn.style.padding = "0 8px";
btn.style.border = "none";
btn.innerHTML = "More Info";
// Change button visibility on changing the property
options.question.registerPropertyChangedHandlers(["popupdescription"], function (newValue) {
btn.style.visibility = !newValue
? "hidden"
: "";
});
if (showPopup) {
let textPopup = options.question.popupdescription;
btn.onclick = function(){
alert(textPopup)
}
}
let header = options.htmlElement.querySelector("h5");
let span = document.createElement("span");
span.innerHTML = " ";
if(header!=null)header.appendChild(span);
if(header!=null)header.appendChild(btn);
}
Regards
Mateusz