Skip to content

Commit 7babf66

Browse files
authored
Merge pull request #340 from asmsuechan/remove-a-menu-on-delete
Remove a menu which is shown on clicked the trash button
2 parents b76729e + 40b7ce6 commit 7babf66

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

browser/main/Detail/MarkdownNoteDetail.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,7 @@ class MarkdownNoteDetail extends React.Component {
181181

182182
}
183183

184-
handleContextButtonClick (e) {
185-
let menu = new Menu()
186-
menu.append(new MenuItem({
187-
label: 'Delete',
188-
click: (e) => this.handleDeleteMenuClick(e)
189-
}))
190-
menu.popup(remote.getCurrentWindow())
191-
}
192-
193-
handleDeleteMenuClick (e) {
184+
handleDeleteButtonClick (e) {
194185
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
195186
type: 'warning',
196187
message: 'Delete a note',
@@ -291,7 +282,7 @@ class MarkdownNoteDetail extends React.Component {
291282
)
292283
})()}
293284
<button styleName='control-trashButton'
294-
onClick={(e) => this.handleContextButtonClick(e)}
285+
onClick={(e) => this.handleDeleteButtonClick(e)}
295286
>
296287
<svg height='17px' id='Capa_1' style={{enableBackground: 'new 0 0 753.23 753.23'}} width='17px' version='1.1' viewBox='0 0 753.23 753.23' x='0px' y='0px' xmlSpace='preserve'>
297288
<g>

browser/main/Detail/SnippetNoteDetail.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,7 @@ class SnippetNoteDetail extends React.Component {
189189

190190
}
191191

192-
handleContextButtonClick (e) {
193-
context.popup([{
194-
label: 'Delete',
195-
click: (e) => this.handleDeleteMenuClick(e)
196-
}])
197-
}
198-
199-
handleDeleteMenuClick (e) {
192+
handleDeleteButtonClick (e) {
200193
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
201194
type: 'warning',
202195
message: 'Delete a note',
@@ -546,7 +539,7 @@ class SnippetNoteDetail extends React.Component {
546539
</div>
547540
<div styleName='info-right'>
548541
<button styleName='control-trashButton'
549-
onClick={(e) => this.handleContextButtonClick(e)}
542+
onClick={(e) => this.handleDeleteButtonClick(e)}
550543
>
551544
<svg height='17px' id='Capa_1' style={{enableBackground: 'new 0 0 753.23 753.23'}} width='17px' version='1.1' viewBox='0 0 753.23 753.23' x='0px' y='0px' xmlSpace='preserve'>
552545
<g>

0 commit comments

Comments
 (0)