Code Monkey home page Code Monkey logo

Comments (6)

lindamarieb avatar lindamarieb commented on May 23, 2024 6

The only thing that worked for me was this:

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

from angular-modal-service.

ledgeJumper avatar ledgeJumper commented on May 23, 2024 5

@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.

from angular-modal-service.

dwmkerr avatar dwmkerr commented on May 23, 2024

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 [email protected] 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
#55.

from angular-modal-service.

josevillacreses avatar josevillacreses commented on May 23, 2024

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.

from angular-modal-service.

josevillacreses avatar josevillacreses commented on May 23, 2024

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();

from angular-modal-service.

dwmkerr avatar dwmkerr commented on May 23, 2024

Thanks everyone, I believe this is closed with @lindamarieb and @ledgeJumper's solutions. Now documented in the FAQS at:

https://github.com/dwmkerr/angular-modal-service#how-can-i-prevent-a-bootstrap-modal-from-being-closed

from angular-modal-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.