forked from 0x2620/oxjs
add some touch support
- fire touch(start|move|end) events after adding clinetX/Y - use touch events in video and timeline widgets - use touchstart to select item in ArrayEditable
This commit is contained in:
parent
72a7d54025
commit
f043242640
7 changed files with 81 additions and 6 deletions
|
|
@ -92,6 +92,11 @@ Ox.VideoPreview = function(options, self) {
|
|||
self.$frame.attr({src: self.options.getFrame(self.options.position)});
|
||||
}
|
||||
})
|
||||
.bindEvent({
|
||||
touchend: touchend,
|
||||
touchmove: touchmove,
|
||||
touchstart: startLoading
|
||||
})
|
||||
.appendTo(that);
|
||||
|
||||
function click(e) {
|
||||
|
|
@ -174,6 +179,19 @@ Ox.VideoPreview = function(options, self) {
|
|||
self.timeout && clearTimeout(self.timeout);
|
||||
}
|
||||
|
||||
function touchend(e) {
|
||||
var position = getPosition(e.clientX - that.offset().left);
|
||||
stopLoading();
|
||||
self.$frame.attr({src: getClosestFrame(position)});
|
||||
that.triggerEvent('click', {
|
||||
position: position
|
||||
});
|
||||
}
|
||||
function touchmove(e) {
|
||||
var position = getPosition(e.clientX - that.offset().left);
|
||||
self.$frame.attr({src: getClosestFrame(position)});
|
||||
}
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue