Tolerance for multiselect

This commit is contained in:
Tobias Reich 2014-02-01 21:50:36 +01:00
parent c980157eca
commit d14a3dbf8b

View File

@ -113,7 +113,8 @@ multiselect = {
getSelection: function(e) {
var id,
var tolerance = 150,
id,
ids = [],
offset,
size = multiselect.getSize();
@ -124,11 +125,11 @@ multiselect = {
$('.photo, .album').each(function() {
offset = $(this).offset();
if (offset.top>=size.top&&
offset.left>=size.left&&
(offset.top+206)<=(size.top+size.height)&&
(offset.left+206)<=(size.left+size.width)) {
if (offset.top>=(size.top-tolerance)&&
offset.left>=(size.left-tolerance)&&
(offset.top+206)<=(size.top+size.height+tolerance)&&
(offset.left+206)<=(size.left+size.width+tolerance)) {
id = $(this).data('id');