Allow to have mutliple buttons on the filepicker
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
e35a31f53b
commit
aa790a3961
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,7 @@ const Dialogs = {
|
|||
FILEPICKER_TYPE_MOVE: 2,
|
||||
FILEPICKER_TYPE_COPY: 3,
|
||||
FILEPICKER_TYPE_COPY_MOVE: 4,
|
||||
FILEPICKER_TYPE_CUSTOM: 5,
|
||||
|
||||
// used to name each dialog
|
||||
dialogsCounter: 0,
|
||||
|
@ -446,6 +447,16 @@ const Dialogs = {
|
|||
click: chooseCallback,
|
||||
defaultButton: true
|
||||
})
|
||||
} else if (type === Dialogs.FILEPICKER_TYPE_CUSTOM) {
|
||||
options.buttons.forEach(function(button) {
|
||||
buttonlist.push({
|
||||
text: button.text,
|
||||
click: function() {
|
||||
functionToCall(button.type)
|
||||
},
|
||||
defaultButton: button.defaultButton
|
||||
})
|
||||
})
|
||||
} else {
|
||||
if (type === Dialogs.FILEPICKER_TYPE_COPY || type === Dialogs.FILEPICKER_TYPE_COPY_MOVE) {
|
||||
buttonlist.push({
|
||||
|
@ -1255,6 +1266,8 @@ const Dialogs = {
|
|||
switch (type) {
|
||||
case this.FILEPICKER_TYPE_CHOOSE:
|
||||
break
|
||||
case this.FILEPICKER_TYPE_CUSTOM:
|
||||
break
|
||||
case this.FILEPICKER_TYPE_COPY:
|
||||
buttons.text(copyText)
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue