added a isMobile() function that adds a shift and ctrl key to the files view, which can be clicked to fake a shift or ctrl key selection event on a tablet/mobile - first pass at this, its fairly usable. I might allow de-selecting the shift or ctrl key if they are pressed again before a selection is used, otherwise this is all functional. Note, I also changed the contextmenu to a click not mouse down on selection of an item in the menu. This is allows me to stop the propagation of the click event which was being trapped by the $(document).on( "click" ... and which we dont want - also exposes a BUG that when I click the context menu onto a different image it does not highlight the new image and some menu items process the original highlight, others the image under the context menu
This commit is contained in:
@@ -223,12 +223,14 @@ function ChangeSize(clicked_button,sz)
|
||||
// whether you click after highlight or before
|
||||
function DoSel(e, el)
|
||||
{
|
||||
if( e.ctrlKey )
|
||||
if( e.ctrlKey || document.fake_ctrl === 1 )
|
||||
{
|
||||
$(el).toggleClass('highlight')
|
||||
if( document.fake_ctrl === 1 )
|
||||
document.fake_ctrl=0
|
||||
return
|
||||
}
|
||||
if( e.shiftKey )
|
||||
if( e.shiftKey || document.fake_shift === 1 )
|
||||
{
|
||||
st=Number($('.highlight').first().attr('ecnt'))
|
||||
end=Number($('.highlight').last().attr('ecnt'))
|
||||
@@ -243,6 +245,9 @@ function DoSel(e, el)
|
||||
$('.entry').slice( end, clicked+1 ).addClass('highlight')
|
||||
else
|
||||
$('.entry').slice( clicked, st ).addClass('highlight')
|
||||
|
||||
if( document.fake_shift === 1 )
|
||||
document.fake_shift=0
|
||||
return
|
||||
}
|
||||
$('.highlight').removeClass('highlight')
|
||||
|
||||
Reference in New Issue
Block a user