add find element to item clips view

This commit is contained in:
rolux 2011-10-30 16:00:21 +00:00
parent f2b401d69b
commit 84f06d50b5
2 changed files with 28 additions and 4 deletions

View file

@ -69,9 +69,7 @@ pandora.ui.clipList = function(videoRatio) {
conditions:[{key: 'id', value: ui.item, operator: '=='}], conditions:[{key: 'id', value: ui.item, operator: '=='}],
operator: '&' operator: '&'
}; };
// fixme: there is currently no way to add a clip query query = pandora.user.ui.itemFind;
// we'll need something like itemFind (vs. listFind)
query = {conditions: [], operator: '&'};
} }
pandora.api.findClips(Ox.extend({ pandora.api.findClips(Ox.extend({
itemsQuery: itemsQuery, itemsQuery: itemsQuery,

View file

@ -1,3 +1,5 @@
// vim: et:ts=4:sw=4:sts=4:ft=javascript
pandora.ui.clipsView = function(videoRatio) { pandora.ui.clipsView = function(videoRatio) {
var that = Ox.SplitPanel({ var that = Ox.SplitPanel({
@ -10,9 +12,33 @@ pandora.ui.clipsView = function(videoRatio) {
.append( .append(
pandora.$ui.orderButton = pandora.ui.orderButton() pandora.$ui.orderButton = pandora.ui.orderButton()
) )
.append(
Ox.Input({
clear: true,
placeholder: 'Find Clips',
value: pandora.user.ui.itemFind.conditions[0]
? pandora.user.ui.itemFind.conditions[0].value : '',
width: 192
})
.css({float: 'right', margin: '4px'})
.bindEvent({
submit: function(data) {
pandora.UI.set('itemFind', data.value ? {
conditions: [{key: 'subtitles', value: data.value, operator: '='}],
operator: '&'
} : pandora.site.user.ui.itemFind);
// since this is the only way itemFind can change,
// there's no need for an event handler
that.replaceElement(1,
pandora.$ui.clipList = pandora.ui.clipList(videoRatio)
);
}
})
),
size: 24
}, },
{ {
element: pandora.$ui.clipList = pandora.ui.clipList(videoRatio); element: pandora.$ui.clipList = pandora.ui.clipList(videoRatio)
} }
], ],
orientation: 'vertical' orientation: 'vertical'