Menu

#55 prevent close

open
nobody
None
2015-06-08
2015-03-22
Anonymous
No

Originally created by: maxdiable

hi, I want to decide when I close the modal, and that it is only the close button to close the modal, you can .

thank you

Massimo

Related

Tickets: #150

Discussion

  • Anonymous

    Anonymous - 2015-03-23

    Originally posted by: dwmkerr

    Hi,

    Please see the FAQ on the read me page. There is a section describing how
    to close a bootstrap modal.

    On Sunday, March 22, 2015, Max notifications@github.com wrote:

    hi, I want to decide when I close the modal, and that it is only the close
    button to close the modal, you can .

    thank you

    Massimo


    Reply to this email directly or view it on GitHub
    https://github.com/dwmkerr/angular-modal-service/issues/55.

     
  • Anonymous

    Anonymous - 2015-04-07

    Originally posted by: josevillacreses

    I'm having the same issue. I want to prevent closing the modal when clicking outside the modal.
    What i find strange is that it works the way I want in the sample http://jsfiddle.net/dwmkerr/8MVLJ/

    Using the same setup from the sample, but with different versions of js libraries, the modal closes when clicking outside.

    Closing the bootstrap modal is not the issue, the problem is not closing it unless my "close()" function is called from the view.

     
  • Anonymous

    Anonymous - 2015-04-08

    Originally posted by: josevillacreses

    In case someone finds this useful, this is how I managed to prevent closing the modal:
    Right before showing the modal with
    modal.element.modal();
    set the modal like this
    $('#curvasModal').modal({
    backdrop: 'static',
    keyboard: true
    });
    modal.element.modal();

     
  • Anonymous

    Anonymous - 2015-05-07

    Originally posted by: lindamarieb

    The only thing that worked for me was this:

    <div class="modal" data-backdrop="static" data-keyboard="false">
    
     
  • Anonymous

    Anonymous - 2015-06-08

    Originally posted by: ledgeJumper

    @josevillacreses that worked for me, thanks! FYI, you can do it in one call instead of the two you have. So replace:

    modal.element.model();
    

    with

    model.element.model({ 
        backdrop: 'static', 
        keyboard: false 
    });
    

    Here is a link to the bootstrap modal options. For those wondering it tells you what is being defaulted here. If the above solution doesn't work try to add in 'show: true' to the options to tell it to allow you to initialize and show it in one go.

     

Log in to post a comment.