Compare commits
3 commits
6b96c9b3ee
...
475a784da5
| Author | SHA1 | Date | |
|---|---|---|---|
| 475a784da5 | |||
| bfb1f95bd5 | |||
| bb563c1d82 |
3 changed files with 26 additions and 0 deletions
|
|
@ -594,6 +594,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
||||||
"id": "keywords",
|
"id": "keywords",
|
||||||
"title": "Keywords",
|
"title": "Keywords",
|
||||||
"type": "layer",
|
"type": "layer",
|
||||||
|
"autocomplete": true,
|
||||||
"filter": true,
|
"filter": true,
|
||||||
"find": true
|
"find": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,12 @@ def editClip(request, data):
|
||||||
clip.item = clip.annotation.item
|
clip.item = clip.annotation.item
|
||||||
clip.annotation = None
|
clip.annotation = None
|
||||||
setattr(clip, {'in': 'start', 'out': 'end'}.get(key), float(data[key]))
|
setattr(clip, {'in': 'start', 'out': 'end'}.get(key), float(data[key]))
|
||||||
|
if 'annotation' in data and not data['annotation']:
|
||||||
|
if clip.annotation:
|
||||||
|
clip.start = clip.annotation.start
|
||||||
|
clip.end = clip.annotation.end
|
||||||
|
clip.item = clip.annotation.item
|
||||||
|
clip.annotation = None
|
||||||
if 'volume' in data:
|
if 'volume' in data:
|
||||||
clip.volume = float(data['volume'])
|
clip.volume = float(data['volume'])
|
||||||
if not clip.annotation:
|
if not clip.annotation:
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ pandora.ui.filterForm = function(options) {
|
||||||
if (key.format && key.format.type == 'ColorPercent') {
|
if (key.format && key.format.type == 'ColorPercent') {
|
||||||
key.format.type = 'percent';
|
key.format.type = 'percent';
|
||||||
}
|
}
|
||||||
|
key.autocomplete = autocompleteFunction(key)
|
||||||
return key;
|
return key;
|
||||||
}).concat([{
|
}).concat([{
|
||||||
id: 'list',
|
id: 'list',
|
||||||
|
|
@ -70,6 +71,24 @@ pandora.ui.filterForm = function(options) {
|
||||||
that.getList = that.$filter.getList;
|
that.getList = that.$filter.getList;
|
||||||
that.value = that.$filter.value;
|
that.value = that.$filter.value;
|
||||||
});
|
});
|
||||||
|
function autocompleteFunction(key) {
|
||||||
|
return key.autocomplete ? function(value, callback) {
|
||||||
|
pandora.api.autocomplete({
|
||||||
|
key: key.id,
|
||||||
|
query: {
|
||||||
|
conditions: [],
|
||||||
|
operator: '&'
|
||||||
|
},
|
||||||
|
range: [0, 100],
|
||||||
|
sort: key.autocompleteSort,
|
||||||
|
value: value
|
||||||
|
}, function(result) {
|
||||||
|
callback(result.data.items.map(function(item) {
|
||||||
|
return Ox.decodeHTMLEntities(item);
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
} : null;
|
||||||
|
}
|
||||||
that.updateResults = function() {
|
that.updateResults = function() {
|
||||||
if (mode == 'list') {
|
if (mode == 'list') {
|
||||||
Ox.Request.clearCache(list.id);
|
Ox.Request.clearCache(list.id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue