fix #1380 (In 'Find Similar Clips' dialog, make select + button a sortElement), rename sequencesDialog to similarClipsDialog

This commit is contained in:
rolux 2013-08-02 09:53:06 +00:00
parent 45e6b1706a
commit c6a0139e1f
2 changed files with 29 additions and 22 deletions

View file

@ -389,7 +389,7 @@ pandora.ui.mainMenu = function() {
} else if (data.id == 'advancedfind') { } else if (data.id == 'advancedfind') {
pandora.$ui.filterDialog = pandora.ui.filterDialog().open(); pandora.$ui.filterDialog = pandora.ui.filterDialog().open();
} else if (data.id == 'findsimilar') { } else if (data.id == 'findsimilar') {
pandora.$ui.sequencesDialog = pandora.ui.sequencesDialog().open(); pandora.$ui.similarClipsDialog = pandora.ui.similarClipsDialog().open();
} else if (data.id == 'documents') { } else if (data.id == 'documents') {
pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open(); pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open();
} else if (data.id == 'titles') { } else if (data.id == 'titles') {
@ -442,7 +442,7 @@ pandora.ui.mainMenu = function() {
}, },
key_alt_control_f: function() { key_alt_control_f: function() {
if (!pandora.hasDialogOrScreen() && pandora.getItemIdAndPosition()) { if (!pandora.hasDialogOrScreen() && pandora.getItemIdAndPosition()) {
pandora.$ui.sequencesDialog = pandora.ui.sequencesDialog().open(); pandora.$ui.similarClipsDialog = pandora.ui.similarClipsDialog().open();
} }
}, },
key_alt_control_shift_a: function() { key_alt_control_shift_a: function() {

View file

@ -2,7 +2,7 @@
'use strict'; 'use strict';
pandora.ui.sequencesDialog = function() { pandora.ui.similarClipsDialog = function() {
var dialogSize = { var dialogSize = {
height: Math.round((window.innerHeight - 48) * 0.9), height: Math.round((window.innerHeight - 48) * 0.9),
@ -69,24 +69,6 @@ pandora.ui.sequencesDialog = function() {
}) })
.appendTo($toolbar), .appendTo($toolbar),
$orderButton = Ox.Button({
title: getTitle(),
tooltip: getTooltip(),
type: 'image'
})
.bindEvent({
click: function() {
pandora.UI.set({sequenceSort: [{
key: pandora.user.ui.sequenceSort[0].key,
operator: pandora.user.ui.sequenceSort[0].operator == '+' ? '-' : '+'
}]});
updateOrderButton();
$list.options({sort: pandora.user.ui.sequenceSort});
}
})
.css({float: 'right', margin: '4px 4px 4px 2px'})
.appendTo($toolbar),
$sortSelect = Ox.Select({ $sortSelect = Ox.Select({
items: ['title', 'director', 'position', 'duration'].map(function(id) { items: ['title', 'director', 'position', 'duration'].map(function(id) {
var item = Ox.getObjectById(pandora.site.itemKeys, id) var item = Ox.getObjectById(pandora.site.itemKeys, id)
@ -110,8 +92,33 @@ pandora.ui.sequencesDialog = function() {
updateOrderButton(); updateOrderButton();
$list.options({sort: pandora.user.ui.sequenceSort}); $list.options({sort: pandora.user.ui.sequenceSort});
} }
}),
$orderButton = Ox.Button({
overlap: 'left',
title: getTitle(),
tooltip: getTooltip(),
type: 'image'
})
.bindEvent({
click: function() {
pandora.UI.set({sequenceSort: [{
key: pandora.user.ui.sequenceSort[0].key,
operator: pandora.user.ui.sequenceSort[0].operator == '+' ? '-' : '+'
}]});
updateOrderButton();
$list.options({sort: pandora.user.ui.sequenceSort});
}
}),
$sortElement = Ox.FormElementGroup({
elements: [$sortSelect, $orderButton],
float: 'right'
})
.css({
float: 'right',
margin: '4px'
}) })
.css({float: 'right', margin: '4px 2px'})
.appendTo($toolbar), .appendTo($toolbar),
$outerPanel = Ox.SplitPanel({ $outerPanel = Ox.SplitPanel({