mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-01 07:48:20 -04:00
Adds ctrl-click file selection.
This commit is contained in:
parent
9545ec2894
commit
8520658c34
1 changed files with 5 additions and 11 deletions
|
@ -31,7 +31,8 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], functio
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$selectionRect
|
$selectionRect
|
||||||
.stop(true, true)
|
.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');
|
var selRect = $selectionRect.fracs('rect');
|
||||||
$('#extended .entry').removeClass('selecting').each(function () {
|
$('#extended .entry').removeClass('selecting').each(function () {
|
||||||
|
@ -76,30 +77,23 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/event'], functio
|
||||||
|
|
||||||
x = event.pageX;
|
x = event.pageX;
|
||||||
y = event.pageY;
|
y = event.pageY;
|
||||||
l = x;
|
|
||||||
t = y;
|
|
||||||
w = 0;
|
|
||||||
h = 0;
|
|
||||||
|
|
||||||
// only on left button and don't block the scrollbars
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
$(':focus').blur();
|
$(':focus').blur();
|
||||||
if (!event.ctrlKey && !event.metaKey) {
|
if (!event.ctrlKey && !event.metaKey) {
|
||||||
$('#extended .entry').removeClass('selected');
|
$('#extended .entry').removeClass('selected');
|
||||||
publish();
|
publish();
|
||||||
}
|
}
|
||||||
$selectionRect
|
|
||||||
.stop(true, true)
|
|
||||||
.css({left: l, top: t, width: w, height: h, opacity: 1})
|
|
||||||
.show();
|
|
||||||
|
|
||||||
$document
|
$document
|
||||||
.on('mousemove', selectionUpdate)
|
.on('mousemove', selectionUpdate)
|
||||||
.one('mouseup', selectionEnd);
|
.one('mouseup', selectionEnd);
|
||||||
|
|
||||||
|
selectionUpdate(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
noSelection = function (event) {
|
noSelection = function (event) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue