dont fail if selected annotation is not present
This commit is contained in:
parent
db6f68681a
commit
01d975878b
1 changed files with 14 additions and 12 deletions
|
@ -215,10 +215,11 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
function renderEditMenu() {
|
||||
var annotation, annotationTitle, folder,
|
||||
isDefined, isEditable, isEvent, isEventOrPlace, isPlace, isString,
|
||||
key, manageTitle, type, value
|
||||
key, manageTitle, type, value;
|
||||
if (self.options.selected) {
|
||||
annotation = getAnnotation(self.options.selected);
|
||||
folder = getFolder(self.options.selected);
|
||||
if(annotation && folder) {
|
||||
key = folder.options('id');
|
||||
type = folder.options('type');
|
||||
value = annotation.value;
|
||||
|
@ -231,6 +232,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
isDefined = isEventOrPlace && !!annotation[type] && !!annotation[type].type;
|
||||
annotationTitle = folder.options('item') + ': "' + value + '"';
|
||||
}
|
||||
}
|
||||
manageTitle = (isDefined ? 'Edit' : 'Define') + ' '
|
||||
+ (isPlace ? 'Place' : isEvent ? 'Event' : 'Place or Event') + '...'
|
||||
self.$editMenuButton && self.$editMenuButton.remove();
|
||||
|
|
Loading…
Reference in a new issue