add drag & drop to clip list in grid view

This commit is contained in:
rolux 2013-07-18 09:52:38 +00:00
parent f8179ea48a
commit 0872435c91
2 changed files with 16 additions and 4 deletions

View file

@ -20,6 +20,13 @@ pandora.ui.editPanel = function() {
return 'editPoints.' + ui.edit.replace(/\./g, '\\.') + '.' + key;
}
function enableDragAndDrop() {
pandora.enableDragAndDrop(
Ox.UI.elements[that.find('.OxIconList').data('oxid')],
edit.editable
);
}
function getSmallTimelineURL() {
var fps = 25,
width = Math.floor(edit.duration * fps),
@ -48,6 +55,7 @@ pandora.ui.editPanel = function() {
clip.position = edit.duration;
edit.duration += clip.duration;
});
updateSmallTimelineURL();
pandora.$ui.mainPanel.replaceElement(1,
that = pandora.$ui.editPanel = Ox.VideoEditPanel({
clips: Ox.clone(edit.clips),
@ -255,6 +263,7 @@ pandora.ui.editPanel = function() {
},
view: function(data) {
pandora.UI.set({clipView: data.view});
data.view == 'grid' && enableDragAndDrop();
},
volume: function(data) {
pandora.UI.set({videoVolume: data.volume});
@ -270,7 +279,7 @@ pandora.ui.editPanel = function() {
}
})
);
updateSmallTimelineURL();
ui.clipView == 'grid' && enableDragAndDrop();
});
}

View file

@ -539,9 +539,12 @@ pandora.enableDragAndDrop = function($list, canMove, section) {
[targetName.singular, Ox.encodeHTMLEntities(drag.target.name)]
)
: Ox._(
'to ' + (section == 'items'
? (pandora.user.ui._list ? 'another' : 'a') + ' ' + targetName.singular
: 'an ' + targetName.singular)
'to ' + (
(section == 'items' && pandora.user.ui._list)
|| (section == 'edits' && pandora.user.ui.section == 'edits')
? 'another' : (section == 'items' ? 'a' : 'an')
) + ' {0}',
[targetName.singular]
)
);
}