Commit b8d2438a by Awais Committed by Awais Qureshi

Fixing bug for track changes issue.

ECOM-7861
parent 4c5518ac
...@@ -38,8 +38,15 @@ function showDiff($object, $historyObject, $outputDiv) { ...@@ -38,8 +38,15 @@ function showDiff($object, $historyObject, $outputDiv) {
} }
function showDiffCourseDetails(currentObject, historyObject, $outputDiv) { function showDiffCourseDetails(currentObject, historyObject, $outputDiv) {
var d = dmp.diff_main(currentObject, historyObject); if (currentObject != historyObject) {
dmp.diff_cleanupEfficiency(d); var d = dmp.diff_main(currentObject, historyObject);
$outputDiv.html(decodeEntities(dmp.diff_prettyHtml(d))); dmp.diff_cleanupSemantic(d);
$outputDiv.show(); $outputDiv.html(decodeEntities(dmp.diff_prettyHtml(d)));
$outputDiv.show();
}
else
{
$outputDiv.html(decodeEntities(currentObject));
$outputDiv.show();
}
} }
...@@ -46,7 +46,8 @@ function loadRevisionHistory(revisionUrl) { ...@@ -46,7 +46,8 @@ function loadRevisionHistory(revisionUrl) {
currentObject = $('.history-field-container').find('.' + key); currentObject = $('.history-field-container').find('.' + key);
if (currentObject.length && value != null) { if (currentObject.length && value != null) {
currentObjectText = getComparableText(currentObject); currentObjectText = getComparableText(currentObject);
value = $($.parseHTML(value)).text().trim(); value = decodeEntities(value);
currentObjectText = decodeEntities(currentObjectText);
showDiffCourseDetails(value, currentObjectText, currentObject.siblings('.show-diff')); showDiffCourseDetails(value, currentObjectText, currentObject.siblings('.show-diff'));
currentObject.hide(); currentObject.hide();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment