make click on clip in clips view open the item at the appropriate position

This commit is contained in:
rolux 2011-10-19 11:49:49 +00:00
parent 0b2a068697
commit 0ef3aa0ad3

View file

@ -7,7 +7,7 @@ pandora.ui.itemClips = function(options) {
margin: '4px' margin: '4px'
}) })
.bindEvent({ .bindEvent({
mousedown: mousedown singleclick: singleclick
}); });
self.options = Ox.extend({ self.options = Ox.extend({
@ -43,8 +43,7 @@ pandora.ui.itemClips = function(options) {
that.append($item); that.append($item);
}); });
function mousedown(data) { function singleclick(data) {
Ox.print('MOUSEDOWN', data)
var $img, $item, $target = $(data.target), $video, points; var $img, $item, $target = $(data.target), $video, points;
if ($target.is('.OxSpecialTarget')) { if ($target.is('.OxSpecialTarget')) {
$item = $target.parent().parent(); $item = $target.parent().parent();
@ -73,7 +72,17 @@ pandora.ui.itemClips = function(options) {
.addClass('OxTarget OxSpecialTarget') .addClass('OxTarget OxSpecialTarget')
.bindEvent({ .bindEvent({
doubleclick: function() { doubleclick: function() {
var item = self.options.id,
set = {
item: item,
itemView: pandora.user.ui.videoView
};
set['videoPoints.' + item] = {
'in': points[0],
out: points[1],
position: points[0]
};
pandora.UI.set(set);
}, },
singleclick: function() { singleclick: function() {
$player.togglePaused(); $player.togglePaused();