mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-24 06:20:07 +01:00
Adds ctrl-click file selection.
This commit is contained in:
parent
9545ec2894
commit
8520658c34
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user