Set default cancelId in JavaScript
This commit is contained in:
parent
b158427271
commit
fb537d91fc
3 changed files with 14 additions and 19 deletions
|
@ -92,7 +92,13 @@ module.exports =
|
|||
options.message ?= ''
|
||||
options.detail ?= ''
|
||||
options.icon ?= null
|
||||
options.cancelId ?= 0
|
||||
|
||||
unless options.cancelId?
|
||||
options.cancelId = 0
|
||||
for text, i in options.buttons
|
||||
if text.toLowerCase() in ['cancel', 'no']
|
||||
options.cancelId = i
|
||||
break
|
||||
|
||||
binding.showMessageBox messageBoxType,
|
||||
options.buttons,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue