[TNL-287] Text Annotation Tool: Reply/Grouping Bug Fix
This commit is contained in:
12
common/static/js/vendor/ova/catch/js/catch.js
vendored
12
common/static/js/vendor/ova/catch/js/catch.js
vendored
@@ -546,9 +546,11 @@ CatchAnnotation.prototype = {
|
||||
// public or is equal to the person with update access, then we leave it alone,
|
||||
// otherwise we need to clean them up (i.e. disable them).
|
||||
if (self.options.userId !== '' && self.options.userId !== value.permissions.update[0]) {
|
||||
$.each(value.highlights, function(key1, value1){
|
||||
$(value1).removeClass('annotator-hl');
|
||||
});
|
||||
if (value.highlights !== undefined) {
|
||||
$.each(value.highlights, function(key1, value1){
|
||||
$(value1).removeClass('annotator-hl');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -1196,11 +1198,11 @@ CatchAnnotation.prototype = {
|
||||
|
||||
annotations.forEach(function(ann){
|
||||
var child, h, _i, _len, _ref;
|
||||
if (ann.highlights !== null) {
|
||||
if (ann.highlights !== undefined) {
|
||||
_ref = ann.highlights;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
h = _ref[_i];
|
||||
if (!(h.parentNode !== null)) {
|
||||
if (!(h.parentNode !== undefined)) {
|
||||
continue;
|
||||
}
|
||||
child = h.childNodes[0];
|
||||
|
||||
@@ -145,15 +145,19 @@ Annotator.Plugin.Grouping = (function(_super) {
|
||||
$.each(lineAnnDict, function(key, val) {
|
||||
if (val.length > self.groupthreshold) {
|
||||
val.forEach(function(anno){
|
||||
$.each(anno.highlights, function(key, anno) {
|
||||
$(anno).css("background-color", "inherit");
|
||||
});
|
||||
if (anno.highlights !== undefined) {
|
||||
$.each(anno.highlights, function(key, anno) {
|
||||
$(anno).css("background-color", "inherit");
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
val.forEach(function(anno) {
|
||||
$.each(anno.highlights, function(key, anno) {
|
||||
$(anno).css("background-color", "rgba(255, 255, 10, .3)");
|
||||
});
|
||||
if (anno.highlights !== undefined) {
|
||||
$.each(anno.highlights, function(key, anno) {
|
||||
$(anno).css("background-color", "rgba(255, 255, 10, .3)");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -187,14 +191,18 @@ Annotator.Plugin.Grouping = (function(_super) {
|
||||
$(newdiv).click(function(evt){
|
||||
if($(evt.srcElement).attr("data-selected") === '0') {
|
||||
annotations.forEach(function(annot){
|
||||
$.each(annot.highlights, function(key, ann) {
|
||||
$(ann).css("background-color", "inherit");
|
||||
});
|
||||
if (annot.highlights !== undefined) {
|
||||
$.each(annot.highlights, function(key, ann) {
|
||||
$(ann).css("background-color", "inherit");
|
||||
});
|
||||
}
|
||||
});
|
||||
self.groupedAnnotations[$(evt.srcElement).css("top").replace("px", "")].forEach(function(item) {
|
||||
$.each(item.highlights, function(key, ann) {
|
||||
$(ann).css("background-color", "rgba(255, 255, 10, 0.3)");
|
||||
});
|
||||
if (item.highlights !== undefined) {
|
||||
$.each(item.highlights, function(key, ann) {
|
||||
$(ann).css("background-color", "rgba(255, 255, 10, 0.3)");
|
||||
});
|
||||
}
|
||||
});
|
||||
$(evt.srcElement).attr("data-selected", '1');
|
||||
} else {
|
||||
@@ -237,9 +245,11 @@ Annotator.Plugin.Grouping = (function(_super) {
|
||||
$(".onOffGroupButton").html("Annotation Grouping: OFF");
|
||||
$(".onOffGroupButton").addClass("buttonOff");
|
||||
this.annotator.plugins.Store.annotations.forEach(function(annot) {
|
||||
$.each(annot.highlights, function(key, ann) {
|
||||
$(ann).css("background-color", "");
|
||||
});
|
||||
if (annot.highlights !== undefined) {
|
||||
$.each(annot.highlights, function(key, ann) {
|
||||
$(ann).css("background-color", "");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// deals with the HighlightTags Plug-In
|
||||
|
||||
Reference in New Issue
Block a user