mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Spillter functionality on touch #1831
This commit is contained in:
parent
e831c6a984
commit
c778c5ad88
@ -664,19 +664,23 @@ define([
|
||||
h('i.fa.fa-ellipsis-v')
|
||||
]);
|
||||
$contentContainer.append(splitter);
|
||||
APP.$splitter = $(splitter).on('mousedown', function (e) {
|
||||
APP.$splitter = $(splitter).on('mousedown touchstart', function (e) {
|
||||
e.preventDefault();
|
||||
var x = e.pageX;
|
||||
var x = e.type === 'touchstart' ? e.originalEvent.touches[0].pageX : e.pageX;
|
||||
var w = $tree.width();
|
||||
|
||||
var handler = function (evt) {
|
||||
if (evt.type === 'mouseup') {
|
||||
$(window).off('mouseup mousemove', handler);
|
||||
return;
|
||||
if (evt.type === 'mouseup' || evt.type === 'touchend') {
|
||||
$(window).off('mouseup mousemove touchend touchmove', handler);
|
||||
return;
|
||||
}
|
||||
$tree.css('width', (w - x + evt.pageX) + 'px');
|
||||
var pageX = evt.type === 'touchmove'
|
||||
? evt.originalEvent.touches[0].pageX
|
||||
: evt.pageX;
|
||||
$tree.css('width', (w - x + pageX) + 'px');
|
||||
};
|
||||
$(window).off('mouseup mousemove', handler);
|
||||
$(window).on('mouseup mousemove', handler);
|
||||
$(window).off('mouseup mousemove touchend touchmove', handler);
|
||||
$(window).on('mouseup mousemove touchend touchmove', handler);
|
||||
});
|
||||
|
||||
// TOOLBAR
|
||||
|
||||
Loading…
Reference in New Issue
Block a user