Comments (5)
Hi! Download the latest version(https://github.com/VodkaBears/Remodal/releases/tag/0.1.7) and read the last post of #23, there was the same problem.
from remodal.
Hi, i downloaded the last version and i have the following problems:
var inst =
inst.open();
That code it is not working now because of this: "TypeError: inst is undefined"
So, i solved the problem using this :
var options = {"closeOnConfirm": false};
$('[data-remodal-id=modal]').remodal(options).open();
But the close modification it is still uncomfortable, when the user press confirm i place a cookie on the browser so i need to close the modal and let him navigate on the web. When he press outside the modal, click close or cancel i use the close and cancel events to redirect the user to my index page.
So, how can i close the modal once the user clicked confirm not triggering the cancel or close events ???
I tried this but once the modal close the close event triggers ... i need to skip that event if the user press confirm.
$(document).on('confirm', '.remodal', function () {
...................
var inst =
inst.close();
});
Thanks a lot !
from remodal.
Well, i solved using a global var (redirect_on_close) that it is defined to "false" in confirm event to check if event close must redirects or not !
from remodal.
Hi, i downloaded the last version and i have the following problems:
var inst =$.remodal.lookup[$ ('[data-remodal-id=modal]').data('remodal')];
inst.open();
That code it is not working now because of this: "TypeError: inst is undefined"
This code must work. Write correct selector and do it when DOM is ready. And, yes, it is not initialization, use it if you need to find already created instance.
$(document).ready(function() {
var inst = $.remodal.lookup[$('[data-remodal-id=your_modal_id]').data('remodal')];
inst.open();
});
or get it in the event handler:
$(document).on('confirm', '.remodal', function () {
var inst = $.remodal.lookup[$(this).data('remodal')];
});
So, i solved the problem using this :
var options = {"closeOnConfirm": false};
$('[data-remodal-id=modal]').remodal(options).open();
Use it if you need to create new modal via JS. Note that remodal creates instances automaticly if you have html like that:
<div class="remodal" data-remodal-id="modal" data-remodal-options='{ "closeOnConfirm": false }'>
...
</div>
Well, i solved using a global var (redirect_on_close) that it is defined to "false" in confirm event to
check if event close must redirects or not!
Ok, that's good.
from remodal.
Thanks for your work. Your script it is the best modal script i found.
from remodal.
Related Issues (20)
- Remodal inside Facebook iframe
- Remodal onload
- No longer actively maintained HOT 10
- Change responsibility web or mobile
- ***wrong post*** HOT 1
- blurry text when opening modal window HOT 2
- form label no checked
- you can use select2 in modal? HOT 3
- Check if modal has been closed once or destroyed HOT 2
- Multiple modal. HOT 1
- Won't trigger on SVG shapes in iOS (solution provided)
- Add no longer actively maintained message on plugin site HOT 1
- modal can't open again when modal closed twice HOT 2
- In IE11, remodal_obj.open() doesn't work properly
- Is there an React version of Remodal?
- New Functionality: send data to remodal from
- appendTo
- It's not working properly on Firefox for Mac HOT 2
- Chrome 80 HOT 1
- not working for netifly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remodal.