Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouserightclick FileExplorer Options #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ The `options` object passed to the FileExplorer class accepts the following opti
* group - An optional string containing a group name. When specified, this must be a unique string that indicates a compatible widget backend to allow cross-widget drag-and-drop and cut/copy/paste to function properly. When not specified, the instance receives a group name unique to the instance that disables the aforementioned cross-widget features.
* alwaysfocused - A boolean that indicates whether or not the widget's appearance never loses focus (Default is false). This only affects visual appearance and does not stop onfocus/onblur event callbacks from firing.
* capturebrowser - A boolean that indicates whether or not to capture the hardware back and forward mouse buttons when the mouse is hovering over the widget (Default is false). Read the 'Known Limitations' section before enabling this feature.
* mouserightclick - A boolean that indicates whether or not to capture right mouse button events (Default is true).
* messagetimeout - An integer containing the number of milliseconds to show short-lived messages in the status bar (Default is 2000).
* displayunits - A string containing one of 'iec_windows', 'iec_formal', or 'si' to specify what units to use when displaying file sizes to the user (Default is 'iec_windows').
* adjustprecision - A boolean indicating whether or not to adjust the final precision when displaying file sizes to the user (Default is true).
Expand Down
7 changes: 4 additions & 3 deletions file-explorer/file-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@

alwaysfocused: false,
capturebrowser: false,
mouserightclick: true,

messagetimeout: 2000,

Expand Down Expand Up @@ -5412,7 +5413,7 @@ console.log('MoveCopyEndHandler');
var orignumselected = numselecteditems;
var origselecteditem = (elem.dataset.feid in selecteditemsmap);

if (e.ctrlKey || e.target.tagName === 'INPUT' || e.button == 2 || selectmodemulti)
if (e.ctrlKey || e.target.tagName === 'INPUT' || (e.button == 2 && $this.settings.mouserightclick) || selectmodemulti)
{
// Ctrl or checkbox.
startrename = false;
Expand Down Expand Up @@ -5440,7 +5441,7 @@ console.log('MoveCopyEndHandler');
window.addEventListener('mouseup', ScrollNoMoveHandler, true);

// Enable right-click context menu.
if (e.button == 2)
if (e.button == 2 && $this.settings.mouserightclick)
{
elems.itemsclipboardoverlay.value = ' ';
elems.itemsclipboardoverlaypastewrap.classList.remove('fe_fileexplorer_hidden');
Expand Down Expand Up @@ -5509,7 +5510,7 @@ console.log(selectanchorpos);
elems.itemswrap.classList.add('fe_fileexplorer_items_selecting');

// Enable right-click context menu.
if (e.button == 2)
if (e.button == 2 && $this.settings.mouserightclick)
{
elems.itemsclipboardoverlay.value = ' ';
elems.itemsclipboardoverlaypastewrap.classList.remove('fe_fileexplorer_hidden');
Expand Down