fix job results out of order case

This commit is contained in:
John Mitchell 2017-02-16 16:09:07 -05:00
parent d730d751d4
commit 656dcdcd2f

View File

@ -365,25 +365,30 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
var putAfter;
var isDup = false;
$(".header_" + putIn + ",." + putIn)
.each((i, v) => {
if (angular.element(v).scope()
.event.start_line < mungedEvent
.start_line) {
putAfter = v;
} else if (angular.element(v).scope()
.event.start_line === mungedEvent
.start_line) {
isDup = true;
return false;
} else if (angular.element(v).scope()
.event.start_line > mungedEvent
.start_line) {
return false;
} else {
appendToBottom(mungedEvent);
}
});
if ($(".header_" + putIn + ",." + putIn).length === 0) {
appendToBottom(mungedEvent);
} else {
$(".header_" + putIn + ",." + putIn)
.each((i, v) => {
if (angular.element(v).scope()
.event.start_line < mungedEvent
.start_line) {
putAfter = v;
} else if (angular.element(v).scope()
.event.start_line === mungedEvent
.start_line) {
isDup = true;
return false;
} else if (angular.element(v).scope()
.event.start_line > mungedEvent
.start_line) {
return false;
} else {
appendToBottom(mungedEvent);
}
});
}
if (!isDup) {
$(putAfter).after($compile(mungedEvent