Giter Site home page Giter Site logo

How would I use this about dialog-effects HOT 6 OPEN

sangyoo91 avatar sangyoo91 commented on August 17, 2024
How would I use this

from dialog-effects.

Comments (6)

wbashir avatar wbashir commented on August 17, 2024

@sangyoo91 Sorry for not having created an official README but this package is a wrapper to the codrops dialog-effects package https://github.com/codrops/DialogEffects. You would use it in a similar fashion but I have modified the source code slightly to allow for explicit open and close functionality.

Example:

var $mainDlg = $('#dialog');
var dlg = new DialogFx($mainDlg);
dlg.open();   // to open the dialog 
dlg.close();  // to close the dialog

To create the dialog, I rendered a template using Blaze.render into any existing DOM element using the following markup.

<div id="somedialog" class="dialog">
    <div class="dialog__overlay"></div>
    <div class="dialog__content">
        <h2><strong>Howdy</strong>, I'm a dialog box</h2><
        div><button class="action" data-dialog-close>Close</button></div>
    </div>
</div>

from dialog-effects.

sangyoo91 avatar sangyoo91 commented on August 17, 2024

@warsamebashir Thank you so much! I'm still fairly new to Meteor. Would it work if I used, for say, {{> dialogConfirm}} and insert it to a template ?

from dialog-effects.

sangyoo91 avatar sangyoo91 commented on August 17, 2024
    'click .delete': function() {
      var $mainDlg = $('#dialog');
      var dlg = new DialogFx($mainDlg);
      dlg.open();

I am using this on Template.foo.events but the dialog would not open. Am I doing something wrong?

from dialog-effects.

wbashir avatar wbashir commented on August 17, 2024

@sangyoo91 Can you show me your Template and how you are inserting dialogConfirm? If the template exists and foo is being rendered, then the div#diailog element should exist allowing you to create the DialogFx object. Also check to see if you have any console errors in your browser?

from dialog-effects.

sangyoo91 avatar sangyoo91 commented on August 17, 2024
<template name = "foo">

{{ > dialogConfirm }}

<button class = "btn-primary delete">Delete</button>

</template>

This would be a minified thing of what I have now.

{{> dialogConfirm}}would be

<div id="dialog" class="dialog">
    <div class="dialog__overlay"></div>
    <div class="dialog__content">
       Something Here
        <div><button class="action" data-dialog-close>Close</button></div>
    </div>
</div>

from dialog-effects.

wbashir avatar wbashir commented on August 17, 2024

Are you at the latest version of this package 1.0.4, from what you have in your example, everything is set up correctly. The DialogFx object will accept a JQuery element or an HTML element and you can check to make sure dlg exists to verify object creation. Otherwise, I will need a reproducible project to test in order to further help

from dialog-effects.

Related Issues (1)

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.