mirror of
https://github.com/codex-team/editor.js
synced 2024-06-03 06:22:39 +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
|
# Changelog
|
||||||
|
|
||||||
|
### 2.11.1
|
||||||
|
|
||||||
|
- `Fix` *RectangeSelection* — Selection is available only for the main mouse button
|
||||||
|
|
||||||
### 2.11.0
|
### 2.11.0
|
||||||
|
|
||||||
- `New` — Add API methods shorthands
|
- `New` — Add API methods shorthands
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@editorjs/editorjs",
|
"name": "@editorjs/editorjs",
|
||||||
"version": "2.11.0",
|
"version": "2.11.1",
|
||||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||||
"main": "dist/editor.js",
|
"main": "dist/editor.js",
|
||||||
"types": "./types/index.d.ts",
|
"types": "./types/index.d.ts",
|
||||||
|
|
|
@ -49,6 +49,11 @@ export default class RectangleSelection extends Module {
|
||||||
private readonly BOTTOM_SCROLL_ZONE = 1;
|
private readonly BOTTOM_SCROLL_ZONE = 1;
|
||||||
private readonly TOP_SCROLL_ZONE = 2;
|
private readonly TOP_SCROLL_ZONE = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id of main button for event.button
|
||||||
|
*/
|
||||||
|
private readonly MAIN_MOUSE_BUTTON = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mouse is clamped
|
* Mouse is clamped
|
||||||
*/
|
*/
|
||||||
|
@ -115,6 +120,7 @@ export default class RectangleSelection extends Module {
|
||||||
});
|
});
|
||||||
|
|
||||||
Listeners.on(container, 'mousedown', (event: MouseEvent) => {
|
Listeners.on(container, 'mousedown', (event: MouseEvent) => {
|
||||||
|
if (event.button !== this.MAIN_MOUSE_BUTTON) { return; }
|
||||||
this.startSelection(event.pageX, event.pageY);
|
this.startSelection(event.pageX, event.pageY);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue