Skip to content

Commit 3e7b913

Browse files
litvinovgchenejac
authored andcommitted
fixes
1 parent e6e0e88 commit 3e7b913

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

webapp/src/main/webapp/js/menupage/pageManagementUtils.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ var pageManagementUtils = {
280280
handleClickDone:function() {
281281
var selectedType = pageManagementUtils.contentTypeSelect.val();
282282
var selectedTypeText = $("#typeSelect option:selected").text();
283-
283+
if(selectedType == "fixedHtml") {
284+
let htmlContent = tinyMCE.get("fixedHTMLValue").getContent();
285+
tinyMCE.get("fixedHTMLValue").remove();
286+
pageManagementUtils.fixedHTMLSection.find("#fixedHTMLValue").val(htmlContent);
287+
}
284288
//Hide all sections
285289
pageManagementUtils.classGroupSection.hide();
286290
pageManagementUtils.fixedHTMLSection.hide();
@@ -368,6 +372,7 @@ var pageManagementUtils = {
368372
if ( _this.contentTypeSelect.val() == "fixedHtml" ) {
369373
pageManagementUtils.headerBar.text(pageManagementUtils.fixedHtml + " - ");
370374
pageManagementUtils.fixedHTMLSection.show();
375+
initTinyMCE.initEditor(pageManagementUtils.fixedHTMLSection.find("#fixedHTMLValue"));
371376
pageManagementUtils.sparqlQuerySection.hide();
372377
pageManagementUtils.searchIndividualsSection.hide();
373378
}
@@ -473,7 +478,6 @@ var pageManagementUtils = {
473478

474479
// Get rid of the cancel link; it'll be replaced by a delete link
475480
$newContentObj.find('span#cancelContent' + counter).html('');
476-
477481
if ( contentType == "sparqlQuery" || contentType == "fixedHtml" || contentType == "searchIndividuals") {
478482
varOrClass = $newContentObj.find('input[name="saveToVar"]').val();
479483
}
@@ -521,6 +525,9 @@ var pageManagementUtils = {
521525
$newDivContainer.appendTo($('section#contentDivs'));
522526
//place new content object
523527
$newContentObj.prependTo($innerDiv);
528+
$newContentObj.find("textarea[name='htmlValue']").each(function() {
529+
initTinyMCE.initEditor($(this));
530+
});
524531
},
525532
bindClonedContentDoneEvent:function($newContentObj) {
526533
//Done button should just collapse the cloned content

webapp/src/main/webapp/js/menupage/processFixedHTMLDataGetterContent.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ var processFixedHTMLDataGetterContent = {
2828
//Now find and set value
2929
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
3030
pageContentSection.find("textarea[name='htmlValue']").val(htmlValue);
31-
initTinyMCE.initEditor(pageContentSection.find("textarea[name='htmlValue']"));
3231
},
3332
//For the label of the content section for editing, need to add additional value
3433
retrieveContentLabel:function() {

0 commit comments

Comments
 (0)