TimHeckel / meteor-bootboxjs

A meteor smart package for the bootstrap bootboxjs plugin
30 stars 19 forks source link

Feature Request: Reactive custom dialog buttons #29

Open gentunian opened 9 years ago

gentunian commented 9 years ago

It would be great to have reactive buttons for custom dialogs, example:

bootbox.dialog({
                title: 'Share your thoughts...',
                message: '<div id="createSessionDialogWrapper"></div>',
                buttons: {
                    success: {
                        label: Session.get('someKey'),
                        className: "btn-success",
                        callback: function () { }
                    },
                    main: {
                        label: "Close",
                        className: "btn-default",
                        callback: function () {});
                        }
                    }
                },
            });

It's common to have dialogs that interacts somehow with the user and I prefer my UI buttons to explicit say what they do. For example, I hate the "accept" and "cancel" buttons. I prefer the button saying what it's doing like "save" (although you know you are on a saving instance, the user shouldn't know about it), or buttons like "Discard changes" instead of "cancel".

I wonder if this package won't break by adding this feature, hoping it won't depend on the label value for doing some actions.

mizzao commented 9 years ago

I usually just do this by putting a Meteor template in a Bootstrap modal. I only use bootbox for simple alert, confirm type dialogs. I don't think it's worth the effort to try and make bootbox reactive.