Commit 17d0ce77b74b54564509569523aa2f46cd5ca1ea
1 parent
1286d403
When doing a Bulk Upload the Large Text Field is not available as MCE.
Jira:KTC-810 Corrected the isHTML json field recognition Committed by: Charl Joseph Mert Reviewed by: Prince Mbekwa
Showing
1 changed file
with
6 additions
and
11 deletions
resources/js/kt_bulkupload.js
| 1 | -function swapInItem(elementId, req) { | 1 | +function swapInItem(docId, elementId, req) { |
| 2 | 2 | ||
| 3 | var cp = getElement(elementId); | 3 | var cp = getElement(elementId); |
| 4 | 4 | ||
| 5 | cp.innerHTML = req.responseText; | 5 | cp.innerHTML = req.responseText; |
| 6 | 6 | ||
| 7 | - | ||
| 8 | - //Sample { "htmlId" : {'metadata_7' : 'metadata_7','metadata_9' : 'metadata_9'}} | ||
| 9 | - jQuery.getJSON('http://localhost/test/presentation/lookAndFeel/knowledgeTree/documentmanagement/getHtmlFields.php?fDocumentTypeID=2', | 7 | + //Sample { "htmlId" : {'metadata_7' : 'metadata_7','metadata_9' : 'metadata_9'}} |
| 8 | + jQuery.getJSON('presentation/lookAndFeel/knowledgeTree/documentmanagement/getHtmlFields.php?fDocumentTypeID=' + docId, | ||
| 10 | function(json){ | 9 | function(json){ |
| 11 | jQuery.each(json.htmlId, function(id) { | 10 | jQuery.each(json.htmlId, function(id) { |
| 12 | //Envoking the MCE editor for each html id | 11 | //Envoking the MCE editor for each html id |
| 13 | jQuery('#' + id).tinymce(kt_TinyMCEOptions); | 12 | jQuery('#' + id).tinymce(kt_TinyMCEOptions); |
| 14 | }); | 13 | }); |
| 15 | }); | 14 | }); |
| 16 | - | ||
| 17 | 15 | ||
| 18 | initialiseConditionalFieldsets(); | 16 | initialiseConditionalFieldsets(); |
| 19 | } | 17 | } |
| @@ -22,18 +20,15 @@ function xmlFailure(err) { | @@ -22,18 +20,15 @@ function xmlFailure(err) { | ||
| 22 | alert('failed'); | 20 | alert('failed'); |
| 23 | } | 21 | } |
| 24 | 22 | ||
| 25 | -function swapElementFromRequest(elementId, url) { | 23 | +function swapElementFromRequest(elementId, url, docId) { |
| 26 | var deff = doSimpleXMLHttpRequest(url); | 24 | var deff = doSimpleXMLHttpRequest(url); |
| 27 | var cp = getElement(elementId); | 25 | var cp = getElement(elementId); |
| 28 | cp.innerHTML=_("loading..."); | 26 | cp.innerHTML=_("loading..."); |
| 29 | - deff.addCallback(partial(swapInItem, elementId)); | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | 27 | + deff.addCallback(partial(swapInItem, docId, elementId)); |
| 33 | } | 28 | } |
| 34 | 29 | ||
| 35 | function getMetadataForType(id) { | 30 | function getMetadataForType(id) { |
| 36 | - swapElementFromRequest('type_metadata_fields','presentation/lookAndFeel/knowledgeTree/documentmanagement/getTypeMetadataFields.php?fDocumentTypeID=' + id); | 31 | + swapElementFromRequest('type_metadata_fields','presentation/lookAndFeel/knowledgeTree/documentmanagement/getTypeMetadataFields.php?fDocumentTypeID=' + id, id); |
| 37 | } | 32 | } |
| 38 | 33 | ||
| 39 | function document_type_changed() { | 34 | function document_type_changed() { |