0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-27 11:43:09 +00:00

Merge pull request #2906 from naturalcrit/SimplifyMouseclickToggle

This commit is contained in:
Charlie
2023-07-03 15:58:47 -05:00
committed by GitHub

View File

@@ -453,16 +453,8 @@ const CodeEditor = createClass({
}; };
}, },
handleMouseDown : function(e) { handleMouseDown : function(e) {
let target = e.target; // Close open widgets if click outside of a widget
let found = false; if(!e.target.matches('.CodeMirror-linewidget *')) {
while (target.parentElement) {
target = target.parentElement;
if(target.classList.contains('CodeMirror-linewidget')) {
found = true;
break;
}
}
if(!found) {
for (const widget of this.state.widgets) { for (const widget of this.state.widgets) {
this.state.widgetUtils.removeLineWidgets(widget); this.state.widgetUtils.removeLineWidgets(widget);
} }