nakupanda / bootstrap3-dialog

Make use of Twitter Bootstrap's modal more monkey-friendly.
https://nakupanda.github.io/bootstrap3-dialog/
1.89k stars 665 forks source link

Trigger 'show.bs.modal' and 'hide.bs.modal' handler when show/hide some html element. #255

Open slbtuga opened 8 years ago

slbtuga commented 8 years ago

Hi.

I have some code that allow me to handle show/hide events

But, with this code, handlers 'show.bs.modal'/'hide.bs.modal' are executed when I show/hide some html element that can cause some problems.

Here is an example

In this example, first statement is for trigger show/hide events. You open 2ª dialog and after when you open 3ª dialog, this dialog stay beyond 2ª dialog. I Think this is because, when hide div element in 3ª dialog, the handle 'hide.bs.modal' is executed changing open property of dialog that cause missing of z-index in 3ª dialog.

I hope you understand what I mean. Can you help me with this?

Thanks. Regards.

nakupanda commented 8 years ago

Please try changing onshow to onshown in the inner dialog.

slbtuga commented 8 years ago

With this change, the user see the html element disapear. I want hide element before show the dialog.

nakupanda commented 8 years ago

Then I would suggest this

                    BootstrapDialog.show({
                      title: '3ª dialog',
                      size: BootstrapDialog.SIZE_WIDE,
                      message: $('<div id="test">test</div>').hide(),
                      onshow: function(diag) {
                        //$('#test', diag.$modalBody).hide();
                      },
                    });  

On show is not a good time point to operate dialog's content.

U-siro commented 8 years ago

I have this problem too.. http://i2bon.kr/dialog_problem.html I not believe same problem as this, but Who can help me? (Try click minecraft pocket edition button)