remove reference to window.pandora in annotation panel

This commit is contained in:
rolux 2014-01-19 12:04:03 +05:30
parent da24434260
commit 89f5329c8b

View file

@ -195,7 +195,7 @@ Ox.AnnotationPanel = function(options, self) {
} }
function renderEditMenu() { function renderEditMenu() {
var annotation, annotationTitle, folder, var annotation, annotationTitle, folder, hasManualCalendarOrMap,
isDefined, isEditable, isEvent, isEventOrPlace, isPlace, isString, isDefined, isEditable, isEvent, isEventOrPlace, isPlace, isString,
key, manageTitle, type, value; key, manageTitle, type, value;
if (self.options.selected) { if (self.options.selected) {
@ -215,6 +215,9 @@ Ox.AnnotationPanel = function(options, self) {
annotationTitle = folder.options('item') + ': "' + value + '"'; annotationTitle = folder.options('item') + ': "' + value + '"';
} }
} }
hasManualCalendarOrMap = self.options.layers.some(function(layer) {
return layer.type == 'event' || layer.type == 'place';
});
manageTitle = Ox._((isDefined ? 'Edit' : 'Define') + ' ' manageTitle = Ox._((isDefined ? 'Edit' : 'Define') + ' '
+ (isPlace ? 'Place' : isEvent ? 'Event' : 'Place or Event') + '...'); + (isPlace ? 'Place' : isEvent ? 'Event' : 'Place or Event') + '...');
self.$editMenuButton && self.$editMenuButton.remove(); self.$editMenuButton && self.$editMenuButton.remove();
@ -233,8 +236,7 @@ Ox.AnnotationPanel = function(options, self) {
{id: 'undo', title: Ox._('Undo Changes'), disabled: !self.editing, keyboard: 'escape'}, {id: 'undo', title: Ox._('Undo Changes'), disabled: !self.editing, keyboard: 'escape'},
{id: 'save', title: Ox._('Save Changes'), disabled: !self.editing, keyboard: isString ? 'return' : 'shift return'}, {id: 'save', title: Ox._('Save Changes'), disabled: !self.editing, keyboard: isString ? 'return' : 'shift return'},
], ],
//FIXME: pandora is not part of Ox.UI hasManualCalendarOrMap ? [
pandora.site.map == 'manual' ? [
{}, {},
{id: 'manage', title: manageTitle, disabled: !self.options.selected || !isEventOrPlace}, {id: 'manage', title: manageTitle, disabled: !self.options.selected || !isEventOrPlace},
] : [], ] : [],