@ -3,6 +3,12 @@
* @ copyright 2015 by Tobias Reich
* /
const isSelectKeyPressed = function ( e ) {
return e . metaKey || e . ctrlKey
}
multiselect = {
ids : [ ]
@ -71,8 +77,8 @@ multiselect.albumClick = function(e, albumObj) {
let id = albumObj . attr ( 'data-id' )
if ( e. metaKey === true ) multiselect . toggleItem ( albumObj , id )
else lychee . goto ( id )
if ( isSelectKeyPressed( e ) ) multiselect . toggleItem ( albumObj , id )
else lychee . goto ( id )
}
@ -80,8 +86,8 @@ multiselect.photoClick = function(e, photoObj) {
let id = photoObj . attr ( 'data-id' )
if ( e. metaKey === true ) multiselect . toggleItem ( photoObj , id )
else lychee . goto ( album . getID ( ) + '/' + id )
if ( isSelectKeyPressed( e ) ) multiselect . toggleItem ( photoObj , id )
else lychee . goto ( album . getID ( ) + '/' + id )
}
@ -251,7 +257,7 @@ multiselect.getSelection = function(e) {
if ( visible . contextMenu ( ) ) return false
if ( ! visible . multiselect ( ) ) return false
if ( e . metaKey === false && ( size . width == 0 || size . height == 0 ) ) {
if ( ! isSelectKeyPressed ( e ) && ( size . width == 0 || size . height == 0 ) ) {
multiselect . close ( )
return false
}