Adds ctrl-click file selection.

This commit is contained in:
Lars Jung 2012-09-18 18:56:50 +02:00
parent 9545ec2894
commit 8520658c34

View File

@ -31,7 +31,8 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], functio
event.preventDefault();
$selectionRect
.stop(true, true)
.css({left: l, top: t, width: w, height: h});
.css({left: l, top: t, width: w, height: h, opacity: 1})
.show();
var selRect = $selectionRect.fracs('rect');
$('#extended .entry').removeClass('selecting').each(function () {
@ -76,30 +77,23 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], functio
x = event.pageX;
y = event.pageY;
l = x;
t = y;
w = 0;
h = 0;
// only on left button and don't block the scrollbars
if (event.button !== 0 || l >= view.right || t >= view.bottom) {
if (event.button !== 0 || x >= view.right || y >= view.bottom) {
return;
}
event.preventDefault();
$(':focus').blur();
if (!event.ctrlKey && !event.metaKey) {
$('#extended .entry').removeClass('selected');
publish();
}
$selectionRect
.stop(true, true)
.css({left: l, top: t, width: w, height: h, opacity: 1})
.show();
$document
.on('mousemove', selectionUpdate)
.one('mouseup', selectionEnd);
selectionUpdate(event);
},
noSelection = function (event) {