move layer selection into annotation options menu

This commit is contained in:
j 2018-08-07 17:46:33 +01:00
parent 8b14537dce
commit 066de44cd2
2 changed files with 26 additions and 22 deletions

View file

@ -492,6 +492,23 @@ Ox.AnnotationPanel = function(options, self) {
};
})}
] : [],
[
{},
{id: 'results', title: Ox._('Find Annotations'), disabled: true},
{group: 'results', max: 1, items: [
{
id: 'result_*',
title: Ox._('All'),
checked: self.options.highlightLayer == '*'
}
].concat(self.options.layers.map(function(result) {
return {
id: 'result_' + result.id,
title: result.title,
checked: result.id == self.options.highlightLayer
};
}))}
],
self.options.showUsers && self.users.length ? [
{},
{id: 'users', title: Ox._('Show Users'), disabled: true},
@ -532,6 +549,10 @@ Ox.AnnotationPanel = function(options, self) {
self.$folder.forEach(function($folder) {
$folder.options({users: self.enabledUsers});
});
} else if (data.id == 'results') {
var layer = data.checked[0].id.split('_').pop()
that.options('highlightLayer', layer);
that.triggerEvent('highlightlayer', self.options.highlightLayer);
} else {
self.options[data.id] = data.checked[0].id;
set[data.id] = self.options[data.id];

View file

@ -791,28 +791,6 @@ Ox.VideoAnnotationPanel = function(options, self) {
})
.appendTo(self.$menubar);
self.$findLayerSelect = Ox.Select({
items: [
{id: '*', title: Ox._('Find: {0}', [Ox._('All')])},
].concat(self.options.layers.map(function(layer) {
return {
id: layer.id,
title: Ox._('Find: {0}', [Ox._(layer.title)])
}
})),
value: self.options.findLayer,
width: 128,
overlap: 'right',
})
.css({float: 'right', background: 'transparent'})
.bindEvent({
change: function(data) {
self.options.findLayer = data.value;
submitFindInput(self.$findInput.value(), false);
},
})
.appendTo(self.$menubar);
self.$nextButton = Ox.Button({
disabled: true,
style: 'symbol',
@ -920,6 +898,11 @@ Ox.VideoAnnotationPanel = function(options, self) {
that.triggerEvent('findannotations', data);
},
focus: that.gainFocus,
highlightlayer: function(data) {
console.log('!! hl', data)
self.options.findLayer = data;
submitFindInput(self.$findInput.value(), false);
},
importannotations: function() {
that.triggerEvent('importannotations');
},