add photo search autocompletion
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
Родитель
d02430f495
Коммит
224e97f585
|
@ -471,5 +471,24 @@ PhotosController.prototype = {
|
|||
});
|
||||
},
|
||||
|
||||
getAutocompData: function() {
|
||||
var that = this;
|
||||
var mData;
|
||||
var data = [];
|
||||
if (this.map.hasLayer(this.photoLayer)) {
|
||||
this.photoLayer.eachLayer(function (l) {
|
||||
mData = l.data;
|
||||
data.push({
|
||||
type: 'photo',
|
||||
label: OC.basename(mData.path),
|
||||
value: OC.basename(mData.path),
|
||||
lat: mData.lat,
|
||||
lng: mData.lng
|
||||
});
|
||||
});
|
||||
}
|
||||
return data;
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1401,6 +1401,9 @@
|
|||
// get devices
|
||||
var devData = devicesController.getAutocompData();
|
||||
data.push(...devData);
|
||||
// get photos
|
||||
var photoData = photosController.getAutocompData();
|
||||
data.push(...photoData);
|
||||
data.push(...this.getExtraAutocompleteData(field));
|
||||
that.currentLocalAutocompleteData = data;
|
||||
fieldElement.autocomplete({
|
||||
|
@ -1413,6 +1416,9 @@
|
|||
else if (it.type === 'contact') {
|
||||
that.map.setView([it.lat, it.lng], 15);
|
||||
}
|
||||
else if (it.type === 'photo') {
|
||||
that.map.setView([it.lat, it.lng], 15);
|
||||
}
|
||||
else if (it.type === 'track') {
|
||||
if (tracksController.isTrackEnabled(it.id)) {
|
||||
tracksController.zoomOnTrack(it.id);
|
||||
|
@ -1475,6 +1481,9 @@
|
|||
if (item.type === 'favorite') {
|
||||
iconClass = 'icon-favorite';
|
||||
}
|
||||
if (item.type === 'photo') {
|
||||
iconClass = 'icon-picture';
|
||||
}
|
||||
else if (item.type === 'track') {
|
||||
iconClass = 'icon-category-monitoring';
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче