mirror of
https://github.com/codex-team/editor.js
synced 2024-05-20 23:36:46 +02:00
Selection is available only for the main mouse button (#629)
* update table * Fix mouse button
This commit is contained in:
parent
75dbc91f53
commit
6cd011140c
6
dist/editor.js
vendored
6
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
### 2.11.1
|
||||
|
||||
- `Fix` *RectangeSelection* — Selection is available only for the main mouse button
|
||||
|
||||
### 2.11.0
|
||||
|
||||
- `New` — Add API methods shorthands
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@editorjs/editorjs",
|
||||
"version": "2.11.0",
|
||||
"version": "2.11.1",
|
||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||
"main": "dist/editor.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
@ -49,6 +49,11 @@ export default class RectangleSelection extends Module {
|
|||
private readonly BOTTOM_SCROLL_ZONE = 1;
|
||||
private readonly TOP_SCROLL_ZONE = 2;
|
||||
|
||||
/**
|
||||
* Id of main button for event.button
|
||||
*/
|
||||
private readonly MAIN_MOUSE_BUTTON = 0;
|
||||
|
||||
/**
|
||||
* Mouse is clamped
|
||||
*/
|
||||
|
@ -115,6 +120,7 @@ export default class RectangleSelection extends Module {
|
|||
});
|
||||
|
||||
Listeners.on(container, 'mousedown', (event: MouseEvent) => {
|
||||
if (event.button !== this.MAIN_MOUSE_BUTTON) { return; }
|
||||
this.startSelection(event.pageX, event.pageY);
|
||||
}, false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue