Include inputOptions for bootbox.prompt

This commit is contained in:
Stanny Nuytkens
2017-03-15 09:56:58 +01:00
committed by Stanny Nuytkens
parent 2cabef6efe
commit e990bd3aeb
2 changed files with 25 additions and 2 deletions
+23 -1
View File
@@ -38,7 +38,29 @@ bootbox.prompt({
console.log(result);
}
});
bootbox.prompt({
title: "This is a prompt with a set of checkbox inputs!",
inputType: 'checkbox',
inputOptions: [
{
text: 'Choice One',
value: '1',
group: 'Group 1'
},
{
text: 'Choice Two',
value: '2',
group: 'Group 1'
},
{
text: 'Choice Three',
value: '3'
}
],
callback: function (result) {
console.log(result);
}
});
bootbox.dialog({
title: "Wassup?",
+2 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Bootbox 4.4.0
// Project: https://github.com/makeusabrew/bootbox
// Definitions by: Vincent Bortone <https://github.com/vbortone/>, Kon Pik <https://github.com/konpikwastaken/>, Anup Kattel <https://github.com/kanup/>, Dominik Schroeter <https://github.com/icereed/>, Troy McKinnon <https://github.com/trodi/>
// Definitions by: Vincent Bortone <https://github.com/vbortone/>, Kon Pik <https://github.com/konpikwastaken/>, Anup Kattel <https://github.com/kanup/>, Dominik Schroeter <https://github.com/icereed/>, Troy McKinnon <https://github.com/trodi/>, Stanny Nuytkens <https://github.com/stannynuytkens>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="jquery" />
@@ -44,6 +44,7 @@ interface BootboxPromptOptions extends BootboxBaseOptions {
inputType?: "text" | "textarea" | "email" | "select" | "checkbox" | "date" | "time" | "number" | "password";
callback: (result: string) => any;
buttons?: BootboxConfirmPromptButtonMap;
inputOptions?: { text: string, value: string, group?: string }[];
}
/** Bootbox options available when setting defaults for modals */