Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Sep 13, 2024
1 parent f1cc408 commit 5826b6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 9 additions & 2 deletions webapp/src/main/webapp/js/menupage/pageManagementUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ var pageManagementUtils = {
handleClickDone:function() {
var selectedType = pageManagementUtils.contentTypeSelect.val();
var selectedTypeText = $("#typeSelect option:selected").text();

if(selectedType == "fixedHtml") {
let htmlContent = tinyMCE.get("fixedHTMLValue").getContent();
tinyMCE.get("fixedHTMLValue").remove();
pageManagementUtils.fixedHTMLSection.find("#fixedHTMLValue").val(htmlContent);
}
//Hide all sections
pageManagementUtils.classGroupSection.hide();
pageManagementUtils.fixedHTMLSection.hide();
Expand Down Expand Up @@ -368,6 +372,7 @@ var pageManagementUtils = {
if ( _this.contentTypeSelect.val() == "fixedHtml" ) {
pageManagementUtils.headerBar.text(pageManagementUtils.fixedHtml + " - ");
pageManagementUtils.fixedHTMLSection.show();
initTinyMCE.initEditor(pageManagementUtils.fixedHTMLSection.find("#fixedHTMLValue"));
pageManagementUtils.sparqlQuerySection.hide();
pageManagementUtils.searchIndividualsSection.hide();
}
Expand Down Expand Up @@ -473,7 +478,6 @@ var pageManagementUtils = {

// Get rid of the cancel link; it'll be replaced by a delete link
$newContentObj.find('span#cancelContent' + counter).html('');

if ( contentType == "sparqlQuery" || contentType == "fixedHtml" || contentType == "searchIndividuals") {
varOrClass = $newContentObj.find('input[name="saveToVar"]').val();
}
Expand Down Expand Up @@ -521,6 +525,9 @@ var pageManagementUtils = {
$newDivContainer.appendTo($('section#contentDivs'));
//place new content object
$newContentObj.prependTo($innerDiv);
$newContentObj.find("textarea[name='htmlValue']").each(function() {
initTinyMCE.initEditor($(this));
});
},
bindClonedContentDoneEvent:function($newContentObj) {
//Done button should just collapse the cloned content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var processFixedHTMLDataGetterContent = {
//Now find and set value
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
pageContentSection.find("textarea[name='htmlValue']").val(htmlValue);
initTinyMCE.initEditor(pageContentSection.find("textarea[name='htmlValue']"));
},
//For the label of the content section for editing, need to add additional value
retrieveContentLabel:function() {
Expand Down

0 comments on commit 5826b6e

Please sign in to comment.