changes in video editor and list map
This commit is contained in:
parent
76466e7eeb
commit
353fce1f14
5 changed files with 41 additions and 26 deletions
|
@ -192,7 +192,7 @@ Ox.ArrayEditable = function(options, self) {
|
|||
self.editing = false;
|
||||
that.blurItem();
|
||||
}
|
||||
Ox.print('AE SELECT ITEM', self.options.selected, self.selected);
|
||||
Ox.print('SELECT ITEM', self.options.selected, self.selected);
|
||||
that.find('.OxSelected').removeClass('OxSelected');
|
||||
self.selected > -1 && self.$items[self.selected].addClass('OxSelected');
|
||||
triggerSelectEvent();
|
||||
|
@ -233,15 +233,16 @@ Ox.ArrayEditable = function(options, self) {
|
|||
position = $element.data('position');
|
||||
if (!$target.is('.OxInput')) {
|
||||
if ($element.length) {
|
||||
if (!$element.is('.OxSelected')) {
|
||||
// if clicked on an element
|
||||
if (position != self.selected) {
|
||||
// select another item
|
||||
selectItem(
|
||||
e.metaKey && position == self.selected
|
||||
? '' : position
|
||||
);
|
||||
selectItem(position);
|
||||
} else if (e.metaKey) {
|
||||
// or deselect current item
|
||||
selectNone();
|
||||
}
|
||||
} else if (!self.blurred) {
|
||||
// if there wasn't an active input element
|
||||
// otherwise, if there wasn't an active input element
|
||||
if (self.editing) {
|
||||
// blur if still in editing mode
|
||||
that.blurItem();
|
||||
|
|
|
@ -69,7 +69,7 @@ Ox.ListMap = function(options, self) {
|
|||
title: 'Id',
|
||||
unique: true,
|
||||
visible: false,
|
||||
width: 64
|
||||
width: 32
|
||||
},
|
||||
{
|
||||
format: function(value, data) {
|
||||
|
@ -326,7 +326,8 @@ Ox.ListMap = function(options, self) {
|
|||
columnsVisible: true,
|
||||
//items: Ox.clone(self.options.places),
|
||||
items: self.options.places,
|
||||
keys: ['area', 'geoname'], // needed for icon and flag
|
||||
// area needed for icon, geoname needed for flag
|
||||
keys: ['area', 'geoname', 'matches'],
|
||||
max: 1,
|
||||
min: 0,
|
||||
pageLength: self.options.pageLength,
|
||||
|
@ -649,7 +650,7 @@ Ox.ListMap = function(options, self) {
|
|||
.appendTo(self.$placeStatusbar);
|
||||
|
||||
self.$addPlaceButton = Ox.Button({
|
||||
tooltip: 'Add Place',
|
||||
title: 'Add Place',
|
||||
width: 90
|
||||
})
|
||||
.css({float: 'right', margin: '4px'})
|
||||
|
@ -833,8 +834,8 @@ Ox.ListMap = function(options, self) {
|
|||
var values = {
|
||||
id: self.selectedPlace,
|
||||
alternativeNames: [], geoname: '', type: '',
|
||||
latitude: null, longitude: null,
|
||||
south: null, west: null, north: null, east: null
|
||||
lat: null, lng: null,
|
||||
south: null, west: null, north: null, east: null, area: null
|
||||
};
|
||||
self.$definePlaceButton.options({disabled: true, title: 'Clearing...'});
|
||||
self.options.editPlace(values, function() {
|
||||
|
@ -848,7 +849,7 @@ Ox.ListMap = function(options, self) {
|
|||
}
|
||||
|
||||
function definePlace() {
|
||||
self.$map.newPlace();
|
||||
self.$map.newPlace(); // this will call selectPlace, then editPlace
|
||||
self.$definePlaceButton.options({title: 'Clear Place'})
|
||||
}
|
||||
|
||||
|
@ -917,6 +918,9 @@ Ox.ListMap = function(options, self) {
|
|||
self.$addPlaceButton.options({disabled: true, title: 'Removing...'})
|
||||
self.options.removePlace({id: self.selectedPlace}, function() {
|
||||
self.$list.options({selected: []}).reloadList(true);
|
||||
self.options.mode == 'define' && self.$definePlaceButton.options({
|
||||
disabled: true
|
||||
});
|
||||
self.$addPlaceButton.options({disabled: false, title: 'Add Place'})
|
||||
});
|
||||
}
|
||||
|
@ -946,6 +950,7 @@ Ox.ListMap = function(options, self) {
|
|||
title: 'Define Place'
|
||||
}).show();
|
||||
self.$addPlaceButton.options({
|
||||
disabled: self.$list.value(self.options.selected, 'matches') > 0,
|
||||
title: 'Remove Place'
|
||||
}).show();
|
||||
}
|
||||
|
@ -960,14 +965,19 @@ Ox.ListMap = function(options, self) {
|
|||
isUndefined = !!self.options.selected
|
||||
&& !self.$list.value(self.options.selected, 'type');
|
||||
Ox.print('isResult', isResult, 'isUndefined', isUndefined, self.options.selected)
|
||||
if (!isUndefined) {
|
||||
if (!(isUndefined && !place.id)) {
|
||||
// if isUndefined && !place.id, then we're handling the
|
||||
// map deselect, which we don't want to pass to the list
|
||||
self.$list.options({
|
||||
selected: place.id && !isResult ? [place.id] : []
|
||||
});
|
||||
}
|
||||
if (place.id) {
|
||||
if (isResult && isUndefined) {
|
||||
place.name = self.$list.value(self.selectedPlace, 'name');
|
||||
self.selectedPlace = self.options.selected;
|
||||
place.id = self.options.selected;
|
||||
place.name = self.$list.value(self.options.selected, 'name');
|
||||
Ox.print('PLACE::::::', place)
|
||||
}
|
||||
self.options.mode == 'define' && self.$findPlaceButton.hide();
|
||||
self.$placeFlag.attr({
|
||||
|
@ -977,19 +987,21 @@ Ox.ListMap = function(options, self) {
|
|||
self.$placeTitle.show();
|
||||
self.$placeForm.values(place).show();
|
||||
self.$areaKmInput.value(Ox.formatArea(place.area));
|
||||
updateMatches();
|
||||
self.$matchesInput.value(place.matches);
|
||||
//updateMatches();
|
||||
self.options.mode == 'define' && self.$definePlaceButton.options({
|
||||
title: isUndefined && !isResult ? 'Define Place' : 'Clear Place'
|
||||
}).show();
|
||||
self.$addPlaceButton.options({
|
||||
disabled: self.options.mode == 'define' && place.matches > 0,
|
||||
title: isResult ? 'Add Place' : 'Remove Place'
|
||||
}).show();
|
||||
if (isResult && isUndefined) {
|
||||
Ox.print('???? s.o.s s.sP', self.options.selected, self.selectedPlace)
|
||||
self.selectedPlace = self.options.selected;
|
||||
self.$map.addPlace(place);
|
||||
self.$addPlaceButton.options({title: 'Remove Place'});
|
||||
editPlace([
|
||||
'geoname', 'type',
|
||||
'latitude', 'longitude',
|
||||
'lat', 'lng',
|
||||
'south', 'west', 'north', 'east', 'area'
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -530,6 +530,7 @@ Ox.Map = function(options, self) {
|
|||
var place = getSelectedPlace(),
|
||||
country = Ox.getCountryByGeoname(place.geoname);
|
||||
Ox.extend(place, data);
|
||||
Ox.print('addPlaceToPlaces, place name:', place.name)
|
||||
self.options.selected = place.id;
|
||||
place.countryCode = country ? country.code : '';
|
||||
Ox.Log('Map', 'addP2P', data, place);
|
||||
|
@ -1132,6 +1133,7 @@ Ox.Map = function(options, self) {
|
|||
self.places.splice(Ox.getIndexById(self.places, place.id), 1);
|
||||
self.resultPlace && self.resultPlace.remove();
|
||||
self.resultPlace = place;
|
||||
Ox.print('removed place, place is now', place);
|
||||
place.marker.update();
|
||||
}
|
||||
|
||||
|
@ -1537,7 +1539,7 @@ Ox.Map = function(options, self) {
|
|||
|
||||
that.value = function(id, key, value) {
|
||||
// fixme: should be like the corresponding List/TextList/etc value function
|
||||
Ox.Log('Map', 'Map.value', id, key, value)
|
||||
Ox.print('Map', 'Map.value', id, key, value)
|
||||
getPlaceById(id).options(key, value);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,8 +261,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
}
|
||||
|
||||
function scrollToSelected(type) {
|
||||
try {
|
||||
Ox.print('scrollToSelected $item', that.find('.OxEditableElement.OxSelected'))
|
||||
//try {
|
||||
var $item = that.find('.OxEditableElement.OxSelected'),
|
||||
itemHeight = $item.height() + (type == 'text' ? 8 : 0),
|
||||
itemTop = $item.offset().top,
|
||||
|
@ -280,9 +279,9 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
scrollTop: scrollTop + 'px'
|
||||
}, 0);
|
||||
}
|
||||
} catch(e) {
|
||||
Ox.print('THIS SHOULD NOT HAPPEN');
|
||||
}
|
||||
//} catch(e) {
|
||||
// Ox.print('THIS SHOULD NOT HAPPEN');
|
||||
//}
|
||||
}
|
||||
|
||||
function selectAnnotation(data, index) {
|
||||
|
|
|
@ -692,7 +692,8 @@ Ox.VideoEditor = function(options, self) {
|
|||
// we need a timeout so that a chained bindEvent
|
||||
// actually catches the event
|
||||
self.options.find && setTimeout(function() {
|
||||
submitFindInput(self.options.find, true);
|
||||
// only submit if no annotation is selected
|
||||
submitFindInput(self.options.find, !self.options.selected);
|
||||
}, 0);
|
||||
|
||||
function addAnnotation(layer) {
|
||||
|
|
Loading…
Reference in a new issue