Comments (8)
This is a little bit optimized, so that you not have to care if there is already an instance or not:
if (typeof currentmodal !== 'undefined' && currentmodal instanceof $.Zebra_Dialog) {currentmodal.close();};
currentmodal = new $.Zebra_Dialog([...]);
With this you do not have to keep track of opened modals.
from zebra_dialog.
AS en extra note:
If you stop the event propagation like this:
$(".alerts").delegate("li", "taphold", function(e) {
e.stopImmediatePropagation(); // otherwise taphold gets executed twice
deleteAlert(this.id);
});
You don't get the extra dialog but after 4 or 5 deletes and going to a new listview, you find the dialog gets created and then animates right off the screen before you can do anything. It's like you're stuck on your own dismiss events.
from zebra_dialog.
Yet again... this time the $.Zebra_dialog is called within an error function and it duplicated the dialog AND the 2nd dialog wouldn't dismiss as described above. The problem seems to be that modal dialogs in an ansynch environment have problems.
from zebra_dialog.
Obviously, this project is dead.
from zebra_dialog.
You have to use the new
keyword for each dialog
from zebra_dialog.
You could also open every Modal/Dialog like this, to prevent to have multiple modals open:
currentmodal.close();
currentmodal = new $.Zebra_Dialog([...]);
from zebra_dialog.
Right. If you can keep track of opened modals then yes, this is a good solution
from zebra_dialog.
How about adding a "singleinstance" param to the plugin that is handling that for you?
Would be nice for example for usages like the notification widget you mentioned in the demos.
from zebra_dialog.
Related Issues (20)
- How close modal in parent window from inside an iframe? HOT 2
- Zebra Dialog with Microsoft Edge HOT 8
- Add version number as public variable
- Focus lost on Android device HOT 2
- Add custom css on buttons
- IE8 compatibility broken
- How to send a value from zebra dialog? HOT 7
- Can I modify the dialog text? HOT 1
- Buttons are displayed in reverse order HOT 1
- Lose of Focus HOT 3
- center_buttons property not centering buttons in latest build HOT 3
- Change Request: Setting default type as false instead of info HOT 1
- if onSave callbacks returns false buttons are permanently disabled HOT 2
- Add option to make dialog draggable HOT 1
- Provide a way to know when a dialog is opening
- button support setting background color HOT 1
- Lost focus after close dialog. HOT 2
- Responsive HOT 16
- No iFrame Scrollbars on iPhones / Touch devices HOT 4
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 zebra_dialog.