dont fail if previously selected id was removed
This commit is contained in:
parent
9e7a639ada
commit
3551e73249
1 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
})
|
||||
);
|
||||
|
||||
self.options.selected && scrollToSelected(
|
||||
self.options.selected && getFolder(self.options.selected) && scrollToSelected(
|
||||
getFolder(self.options.selected).options('type')
|
||||
);
|
||||
|
||||
|
@ -382,7 +382,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
function scrollToSelected(type) {
|
||||
var $item = that.find('.OxEditableElement.OxSelected'),
|
||||
itemHeight = $item.height() + (type == 'text' ? 8 : 0),
|
||||
itemTop = $item.offset().top,
|
||||
itemTop = ($item.offset() || {}).top,
|
||||
itemBottom = itemTop + itemHeight,
|
||||
height = self.$folders.height(),
|
||||
scrollTop = self.$folders.scrollTop(),
|
||||
|
|
Loading…
Reference in a new issue