From 230e38fa51515b1443711dcebfa5b5f4ddade5cb Mon Sep 17 00:00:00 2001 From: Oleksandr Mishchuk Date: Wed, 17 Jun 2015 23:23:25 +0200 Subject: [PATCH] Fix selection box --- js/helpers/application_helpers.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/helpers/application_helpers.js b/js/helpers/application_helpers.js index a4ec670..0d10aaf 100644 --- a/js/helpers/application_helpers.js +++ b/js/helpers/application_helpers.js @@ -43,11 +43,16 @@ kettu.ApplicationHelpers = { enableDragging: function() { if(!kettu.app.mobile) { + var context = this; // Setting distance to non-zero allows our custom single-click // and double-click behavior $("#torrents").selectable({distance: 1}); $("#torrents").bind("selectablestop", function() { + var torrents = $('.torrent.ui-selected'); $('#context_menu').hide(); + context.highlightTorrents(torrents); + if(context.infoIsOpen()) { context.redirect('#/torrent_details'); } + $('#search').focus(); kettu.app.trigger('refresh-torrent-details'); }); }