mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 11:35:54 +08:00
Ignore double-click on Markdown cells (#1937)
This commit is contained in:
parent
3e1067f4b5
commit
df51b9d6d6
1 changed files with 0 additions and 15 deletions
|
@ -85,14 +85,12 @@ const Session = {
|
||||||
this._handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
this._handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
||||||
this._handleDocumentFocus = this.handleDocumentFocus.bind(this);
|
this._handleDocumentFocus = this.handleDocumentFocus.bind(this);
|
||||||
this._handleDocumentClick = this.handleDocumentClick.bind(this);
|
this._handleDocumentClick = this.handleDocumentClick.bind(this);
|
||||||
this._handleDocumentDoubleClick = this.handleDocumentDoubleClick.bind(this);
|
|
||||||
|
|
||||||
document.addEventListener("keydown", this._handleDocumentKeyDown, true);
|
document.addEventListener("keydown", this._handleDocumentKeyDown, true);
|
||||||
document.addEventListener("mousedown", this._handleDocumentMouseDown);
|
document.addEventListener("mousedown", this._handleDocumentMouseDown);
|
||||||
// Note: the focus event doesn't bubble, so we register for the capture phase
|
// Note: the focus event doesn't bubble, so we register for the capture phase
|
||||||
document.addEventListener("focus", this._handleDocumentFocus, true);
|
document.addEventListener("focus", this._handleDocumentFocus, true);
|
||||||
document.addEventListener("click", this._handleDocumentClick);
|
document.addEventListener("click", this._handleDocumentClick);
|
||||||
document.addEventListener("dblclick", this._handleDocumentDoubleClick);
|
|
||||||
|
|
||||||
this.getElement("sections-list").addEventListener("click", (event) => {
|
this.getElement("sections-list").addEventListener("click", (event) => {
|
||||||
this.handleSectionsListClick(event);
|
this.handleSectionsListClick(event);
|
||||||
|
@ -255,7 +253,6 @@ const Session = {
|
||||||
document.removeEventListener("mousedown", this._handleDocumentMouseDown);
|
document.removeEventListener("mousedown", this._handleDocumentMouseDown);
|
||||||
document.removeEventListener("focus", this._handleDocumentFocus, true);
|
document.removeEventListener("focus", this._handleDocumentFocus, true);
|
||||||
document.removeEventListener("click", this._handleDocumentClick);
|
document.removeEventListener("click", this._handleDocumentClick);
|
||||||
document.removeEventListener("dblclick", this._handleDocumentDoubleClick);
|
|
||||||
|
|
||||||
setFavicon("favicon");
|
setFavicon("favicon");
|
||||||
|
|
||||||
|
@ -566,18 +563,6 @@ const Session = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Enters insert mode when a markdown cell is double-clicked.
|
|
||||||
*/
|
|
||||||
handleDocumentDoubleClick(event) {
|
|
||||||
const cell = event.target.closest(`[data-el-cell]`);
|
|
||||||
const type = cell && cell.getAttribute("data-type");
|
|
||||||
|
|
||||||
if (type && type === "markdown" && this.focusedId && !this.insertMode) {
|
|
||||||
this.setInsertMode(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles section link clicks in the section list.
|
* Handles section link clicks in the section list.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue