1
0
Fork 0
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:
j 2016-07-27 21:13:09 +02:00
commit f043242640
7 changed files with 81 additions and 6 deletions

View file

@ -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;
};