forked from 0x2620/oxjs
make selected annotation scroll into view
This commit is contained in:
parent
e4dd393834
commit
923f71e6de
4 changed files with 30 additions and 11 deletions
|
|
@ -25,7 +25,11 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
collapsed: false,
|
||||
editable: false,
|
||||
id: '',
|
||||
'in': 0,
|
||||
item: '',
|
||||
items: [],
|
||||
out: 0,
|
||||
position: 0,
|
||||
range: 'all',
|
||||
selected: '',
|
||||
sort: 'position',
|
||||
|
|
@ -57,7 +61,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
id: 'add',
|
||||
style: 'symbol',
|
||||
title: 'add',
|
||||
tooltip: 'Add',
|
||||
tooltip: 'Add ' + self.options.item,
|
||||
type: 'image'
|
||||
}).bindEvent({
|
||||
click: function(data) {
|
||||
|
|
@ -131,9 +135,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
function selectAnnotation(data) {
|
||||
var item = Ox.getObjectById(self.options.items, data.id);
|
||||
self.options.selected = item ? data.id : '';
|
||||
that.triggerEvent('select', Ox.extend({
|
||||
id: data.id
|
||||
}, item ? {
|
||||
that.triggerEvent('select', Ox.extend(data, item ? {
|
||||
'in': item['in'],
|
||||
out: item.out,
|
||||
layer: self.options.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue