mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
Added checkboxes selection without mouse option.
This commit is contained in:
parent
08cd031367
commit
79d24d5f36
2 changed files with 14 additions and 9 deletions
|
@ -2,6 +2,7 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/resource', 'core
|
|||
|
||||
var settings = _.extend({
|
||||
enabled: false,
|
||||
mouse: false,
|
||||
checkboxes: false
|
||||
}, allsettings.select);
|
||||
var template = '<span class="selector"><img src="' + resource.image('selected') + '" alt="selected"/></span>';
|
||||
|
@ -184,21 +185,23 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/resource', 'core
|
|||
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
if (!settings.enabled || (!settings.mouse && !settings.checkboxes)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$selectionRect.hide().appendTo('body');
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
|
||||
if (settings.mouse) {
|
||||
$selectionRect.hide().appendTo('body');
|
||||
|
||||
// $document
|
||||
$('#content')
|
||||
.on('mousedown', '.noSelection', noSelection)
|
||||
.on('mousedown', '.noSelectionUnlessCtrl,input,select,a', noSelectionUnlessCtrl)
|
||||
.on('mousedown', selectionStart);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
|
|
|
@ -257,13 +257,15 @@ Options
|
|||
},
|
||||
|
||||
/*
|
||||
Make entries selectable (first mouse button + drag).
|
||||
Make entries selectable.
|
||||
At the moment only needed for packaged download.
|
||||
|
||||
- mouse: boolean, allow first mouse button + drag selection
|
||||
- checkboxes: boolean, show a checkbox on mouse over item
|
||||
*/
|
||||
"select": {
|
||||
"enabled": true,
|
||||
"mouse": true,
|
||||
"checkboxes": true
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue