1
0
Fork 0
forked from 0x2620/oxjs

allow for annotation highlight if same value

This commit is contained in:
rolux 2018-10-12 14:46:38 +02:00
commit 6eb3b0bb6f
4 changed files with 21 additions and 14 deletions

View file

@ -38,7 +38,7 @@ Ox.AnnotationFolder = function(options, self) {
collapsed: false,
editable: false,
highlight: '',
highlightAnnotations: false,
highlightAnnotations: 'none',
id: '',
'in': 0,
item: '',
@ -479,7 +479,9 @@ Ox.AnnotationFolder = function(options, self) {
);
}).map(function(item) {
return Ox.extend(item, {
group: item['in'] + '-' + item.out
group: self.options.highlightAnnotations == 'none' ? ''
: self.options.highlightAnnotations == 'value' ? item.value
: item['in'] + '-' + item.out
});
});
return annotations;
@ -650,7 +652,9 @@ Ox.AnnotationFolder = function(options, self) {
function updateAnnotations() {
self.annotations = getAnnotations();
self.$annotations.options({highlightGroup: self.options.highlightAnnotations != 'none'});
self.$annotations.options({items: self.annotations});
self.$annotations.updateItemGroup();
showWarnings();
if (self.widget) {
self.options.type == 'event'
@ -746,10 +750,10 @@ Ox.AnnotationFolder = function(options, self) {
Ox.forEach(data, function(value, key) {
item[key] = value;
});
item.group = item['in'] + '-' + item.out;
if (self.options.highlightAnnotations) {
self.$annotations.updateItemGroup();
}
item.group = self.options.highlightAnnotations == 'none' ? ''
: self.options.highlightAnnotations == 'value' ? item.value
: item['in'] + '-' + item.out;
self.$annotations.updateItemGroup();
if (id != item.id) {
self.$annotations.find('.OxEditableElement').each(function() {
var $element = $(this);