javascript - How can I use two twitter bootstrap modals in succession? -
this minor, subtle point, in ux, subtlety makes difference.
i have crafted 1-page web app using twitter bootstrap. in 1 particularly important part of application...
- my user takes action,
- i present confirmation dialog (technically bootbox confirm)
- the user clicks ok confirm
- the modal disappears, action via ajax takes place,
- then display secondary modal (bootbox dialog) success message.
what trying change step 4. don't want darkened overlay disappear, dialog box itself. instead, leave background dimmed , display spinner (spin.js of course) replaced success modal upon ajax completion.
in short, think may need override default behavior of success method of bootbox confirm.
is possible?
it should work if listen close event on first modal
$(document).on('close', '#firstmodalid', function(){ $('#secondmodalid').modal('show'); });
you can try closed event. if timed right user shouldn't see both @ same time , shouldn't see 1 disappear when other opens. careful of crashing ie when using 2 bootstrap modals @ same time.
one other possibility i've used open second modal without backdrop , @ same time changing z-index of first modal looks it's gone. when second modal closes can either return first modal original z-index or close normal. whether can take route depends on whether or not want backdrop click behavior in second modal.
Comments
Post a Comment