Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modal.leanModal({dismissible:false}) does not work: tested #1464

Closed
rkstar opened this issue Jun 1, 2015 · 16 comments
Closed

modal.leanModal({dismissible:false}) does not work: tested #1464

rkstar opened this issue Jun 1, 2015 · 16 comments

Comments

@rkstar
Copy link

rkstar commented Jun 1, 2015

issue #1239 is valid.

tested and demonstrated here: http://codepen.io/anon/pen/oXBKeg
using example copied from: http://materializecss.com/modals.html

OSX Yosemite / Chrome
Version 43.0.2357.81 (64-bit)

OSX Yosemite / Firefox
Version 38.0.1

@Dogfalo
Copy link
Owner

Dogfalo commented Jun 2, 2015

the open function allows you to pass in different options. The leanModal call is for setting up a trigger and is not meant to be called on the modal itself. http://codepen.io/Dogfalo/pen/qdrBev

@Dogfalo Dogfalo closed this as completed Jun 2, 2015
@rkstar
Copy link
Author

rkstar commented Jun 2, 2015

Please update the documentation to reflect this.

@neopostmodern
Copy link

Ran into this too, please update documentation.

It's very unintuitive, I'd even call for a design change, such that calling openModal without any arguments would default to the arguments it's been initialized with.

@bsrdjan
Copy link

bsrdjan commented Aug 7, 2015

Is it possible to set "ready" and "complete" callback functions of the modal, without opening the modal ?

@suryasarafe1
Copy link

mdoals

its added to documenttaion.

@erBhushanPawar
Copy link

The problem is with including jquery. if you have 2 jquery included while setting no conflict to $ use jQuery 2.1X.x and it will work for you !

include in following order

src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
rel="stylesheet" href="./css/materialize.min.css" media="screen,projection"/>
src="./js/velocity.min.js"></script>
src="js/materialize.min.js"></script>

Hope this will help you

@vmkazakoff
Copy link

Thanks @erBhushanPawar! My mistake is including materializecss.js before jquery and I have a lot of problems - not working modals, toasts etc... You save my day!

@conrald07
Copy link

hey guys. I've got a serious problem with modals. it doesnt' respond. I've initialised and done the coding - a copy and paste from the website- but it still doesnt work. Please could some one just post the code to include in my js file. i think that is where my prob is.

@erBhushanPawar
Copy link

$('#modalConfirmOrder').openModal({ dismissible: false, // Modal can't be dismissed by clicking outside of the modal opacity: .5, // Opacity of modal background in_duration: 300, // Transition in duration out_duration: 200, // Transition out duration ready: function() { }, // Callback for Modal open complete: function() { /*alert('Closed');*/ } // Callback for Modal close });

also make sure that you have addressed previous solution too

@conrald07
Copy link

thanks a lot @erBhushanPawar. But just one more question. i"ld like to call this function onclick(an image for example). this code runs from when my tab loads.

@conrald07
Copy link

Oh. I got it!!!. Thanks again.

@fedpettinella
Copy link

@Dogfalo Could you please add it back to the documentation? Why was it taken out again? It's important to know that openModal() can take options.

@dbr0
Copy link

dbr0 commented Dec 4, 2016

There is no more openModal(). It's been changed to .modal('open').
Does anyone knows how to open modal and add a callback now?

Also does anyone else has problems with opening modals programatically using the .modal('open')? It seems it doesn't work for me.

@erBhushanPawar
Copy link

@dbr0 Dude, I think they have adapted bootstrap method this time. I hope this document will help you http://www.w3schools.com/bootstrap/bootstrap_ref_js_modal.asp

@dbr0
Copy link

dbr0 commented Dec 6, 2016

@erBhushanPawar Using .modal('show')' from link you have given gives Error: Method show does not exist on jQuery.modal`.

@bspatil0001
Copy link

bspatil0001 commented Sep 5, 2017

Not working on clicking on browser back button.

Still the modal '.modal-overlay' exist on DOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests