1
0
Fork 0
forked from 0x2620/oxjs

make selected annotation scroll into view

This commit is contained in:
rlx 2012-01-11 15:02:33 +05:30
commit 923f71e6de
4 changed files with 30 additions and 11 deletions

View file

@ -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