Code Monkey home page Code Monkey logo

Comments (8)

DJaeger avatar DJaeger commented on September 27, 2024 1

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.

ppetree avatar ppetree commented on September 27, 2024

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.

ppetree avatar ppetree commented on September 27, 2024

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.

zebra_dialog_err

from zebra_dialog.

ppetree avatar ppetree commented on September 27, 2024

Obviously, this project is dead.

from zebra_dialog.

stefangabos avatar stefangabos commented on September 27, 2024

You have to use the new keyword for each dialog

from zebra_dialog.

DJaeger avatar DJaeger commented on September 27, 2024

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.

stefangabos avatar stefangabos commented on September 27, 2024

Right. If you can keep track of opened modals then yes, this is a good solution

from zebra_dialog.

DJaeger avatar DJaeger commented on September 27, 2024

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)

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.