diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index f9982fe2b..7d7adbf65 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -138,6 +138,12 @@ display: none; } } + + #cp-app-drive-content-container { + .cp-splitter { + display: none; + } + } } } @@ -493,7 +499,7 @@ } } } - + /* CONTENT */ #cp-app-drive-content-container { display: flex; @@ -512,6 +518,13 @@ display: flex; align-items: center; justify-content: flex-end; + touch-action: none; + -ms-touch-action: none; + -webkit-touch-action: none; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; &:hover { border-left: 1px solid @cryptpad_text_col; } diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 2c3213676..ae84d4368 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -660,25 +660,30 @@ define([ var $trashContextMenu = $("#cp-app-drive-context-trash"); $content.attr("tabindex", "0"); - var splitter = h('div.cp-splitter', [ - h('i.fa.fa-ellipsis-v') - ]); - $contentContainer.append(splitter); - APP.$splitter = $(splitter).on('mousedown', function (e) { - e.preventDefault(); - var x = e.pageX; - var w = $tree.width(); - var handler = function (evt) { - if (evt.type === 'mouseup') { - $(window).off('mouseup mousemove', handler); - return; - } - $tree.css('width', (w - x + evt.pageX) + 'px'); - }; - $(window).off('mouseup mousemove', handler); - $(window).on('mouseup mousemove', handler); - }); - + if (APP.loggedIn) { + var splitter = h('div.cp-splitter', [ + h('i.fa.fa-ellipsis-v') + ]); + $contentContainer.append(splitter); + APP.$splitter = $(splitter).on('mousedown touchstart', function (e) { + e.preventDefault(); + var x = e.type === 'touchstart' ? e.originalEvent.touches[0].pageX : e.pageX; + var w = $tree.width(); + + var handler = function (evt) { + if (evt.type === 'mouseup' || evt.type === 'touchend') { + $(window).off('mouseup mousemove touchend touchmove', handler); + return; + } + var pageX = evt.type === 'touchmove' + ? evt.originalEvent.touches[0].pageX + : evt.pageX; + $tree.css('width', (w - x + pageX) + 'px'); + }; + $(window).off('mouseup mousemove touchend touchmove', handler, { passive: false }); + $(window).on('mouseup mousemove touchend touchmove', handler); + }); + } // TOOLBAR // DRIVE