I'm breaking up an xml diff into nodes and comparing the nodes w/ mergely on different bootstrap tabs. So 5 different compares in one tab control. Problem I have is my default tab populates great. When I tab over it does not populate as I would expect. I tried creating an event on toggle and Updateing? I'm getting an error within mergely.js. I tried clearing the sides and re-diffing, It responds but now I have to click on the div for it to populate and the scroll doesn't seem to function right and the markup is incorrect.
Here's my script, my toggle function is just trying to get the first tab to work properly before I correctly. I'm using the diff file to set badge numbers at the top of the tab w/ difference counts. Thanks for your help.
var eleArray = []
eleArray[0] = { tab: "#home", div: "#HEADER", data: "headerData", num: 0 }
eleArray[1] = { tab: "#menu1", div: "#PWB", data: "pwbData", num: 0 }
eleArray[2] = { tab: "#menu2", div: "#PLACEMENT", data: "placementData", num: 0 }
eleArray[3] = { tab: "#menu3", div: "#COMPONENT", data: "componentData", num: 0 }
eleArray[4] = { tab: "#menu4", div: "#PICK", data: "pickData", num: 1 }
$(window).on('shown.bs.modal', function () {
$('#myModal').modal('show');
eleArray.forEach(function (row) {
$(row.div).mergely({
width: 'auto',
height: 575,
cmsettings: { mode: "text/xml", readOnly: true, lineWrapping: false, lineNumbers: true },
lhs: function (setvalue) {
setvalue($("#old_" + row.data).val());
},
rhs: function (setvalue) {
setvalue($("#new_" + row.data).val());
}
});
$('#dif_' + row.data).val($(row.div).mergely('diff'));
var bNum = $('#dif_' + row.data).val().split("---").length - 1
if (bNum > 0) { $('a[href="' + row.tab + '"]').find('.badge').text(bNum); };
});
});
$(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function () {
console.log($(this).attr('href'));
if ($(this).attr('href') == "#menu1") {
$("#PWB").mergely('unmarkup');
$("#PWB").mergely('update');
console.log("itworked");
}
});
--
You received this message because you are subscribed to the Google Groups "Mergely" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mergely+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.