mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
Desktop: Close Goto Anything
modal on outside click (#2940)
* Close goto modal on outside click * Renamed for consistency Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
parent
ce24942a03
commit
52ba5c5bb7
@ -48,6 +48,7 @@ class Dialog extends React.PureComponent {
|
||||
this.onKeyDown = this.onKeyDown.bind(this);
|
||||
this.input_onChange = this.input_onChange.bind(this);
|
||||
this.input_onKeyDown = this.input_onKeyDown.bind(this);
|
||||
this.modalLayer_onClick = this.dialogModalLayer_onClick.bind(this);
|
||||
this.listItemRenderer = this.listItemRenderer.bind(this);
|
||||
this.listItem_onClick = this.listItem_onClick.bind(this);
|
||||
this.helpButton_onClick = this.helpButton_onClick.bind(this);
|
||||
@ -114,6 +115,14 @@ class Dialog extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
modalLayer_onClick() {
|
||||
this.props.dispatch({
|
||||
pluginName: PLUGIN_NAME,
|
||||
type: 'PLUGIN_DIALOG_SET',
|
||||
open: false,
|
||||
});
|
||||
}
|
||||
|
||||
helpButton_onClick() {
|
||||
this.setState({ showHelp: !this.state.showHelp });
|
||||
}
|
||||
@ -385,7 +394,7 @@ class Dialog extends React.PureComponent {
|
||||
const helpComp = !this.state.showHelp ? null : <div style={style.help}>{_('Type a note title to jump to it. Or type # followed by a tag name, or @ followed by a notebook name, or / followed by note content.')}</div>;
|
||||
|
||||
return (
|
||||
<div style={theme.dialogModalLayer}>
|
||||
<div onClick={this.modalLayer_onClick} style={theme.dialogModalLayer}>
|
||||
<div style={style.dialogBox}>
|
||||
{helpComp}
|
||||
<div style={style.inputHelpWrapper}>
|
||||
|
Loading…
Reference in New Issue
Block a user