Giter VIP home page Giter VIP logo

Comments (12)

saribe avatar saribe commented on August 31, 2024

Hi, where did you get this example?

Events work as a promise!
Take a look:

var options = {
    message: "The famous question?",
    title: 'Header title',
    size: eModal.size.sm,
    subtitle: 'smaller text header',
    label: 'Yes'
};

eModal
   .alert(options)
   .then( 
       function(){ alert(1); },
       function(){ alert(2); }
   );

Hope that help, see more examples in example site Http://saribe.github.io/eModal

from emodal.

pbernim avatar pbernim commented on August 31, 2024

Hi,

Thanks a lot for your help!

That's what I need

Now it's work!

from emodal.

saribe avatar saribe commented on August 31, 2024

NIce to know,
Please feel free to contact me if you need any further information.

from emodal.

pbernim avatar pbernim commented on August 31, 2024

Thanks again for your help.

Another question:

How can I change the colour of the buttons?

I have by default:

Yes = blue
No = red

I need Yes = red

Thanks

var options = {
message: "Do you really want to delete this record?",
title: 'Confirmation',
size: eModal.size.sm,
label: 'Yes'
};

    eModal.confirm(options).then(
        function(){ alert(1); },
        function(){ alert(2); }
        );

from emodal.

saribe avatar saribe commented on August 31, 2024

You can do it in multiple ways:

  • Query DOM and change it.
    • When you execute eModal.ACTION, it returns a promise and in the
      promise object, you will find the modal's DOM element.

e.g.; var promise = eModal
.confirm("Hello")
.then(OKfn, KOfn);

    promise.element.find(".btn"); <- this wil return a list of buttons

(.btn class)

  • Provide custom buttons.
    • If you provide your buttons in object options, you can define a
      class

      ,
      buttons: [
      { close: true, click: callback1, text: "btn-danger", style: "danger"
      },
      { close: true, click: callback2, text: "btn-info" style: "info" }, {
      close: true, click: callback3, text: "Other", style: " other" }, //<-
      notice the space before
      { close: true, click: callback4, text: "CSS", css: {
      background-color: 'pink', color: 'blue' } }
      ],

Samuel Ribeiro Pinto

2016-01-25 13:50 GMT+00:00 spilxx [email protected]:

Thanks again for your help.

Another question:

How can I change the colour of the buttons?

I have by default:

Yes = blue
No = red

I need Yes = red

Thanks

var options = {
message: "Do you really want to delete this record?",
title: 'Confirmation',
size: eModal.size.sm,
label: 'Yes'
};

eModal.confirm(options).then(
    function(){ alert(1); },
    function(){ alert(2); }
    );


Reply to this email directly or view it on GitHub
#31 (comment).

from emodal.

saribe avatar saribe commented on August 31, 2024

Note: if the ACTION in use, already has buttons (e.g.: prompt), your
custom buttons will be addded on left, this will not replace the "native"
ones.

Samuel Ribeiro Pinto

2016-01-25 15:32 GMT+00:00 Samuel Pinto [email protected]:

You can do it in multiple ways:

  • Query DOM and change it.
    • When you execute eModal.ACTION, it returns a promise and in the
      promise object, you will find the modal's DOM element.

e.g.; var promise = eModal
.confirm("Hello")
.then(OKfn, KOfn);

    promise.element.find(".btn"); <- this wil return a list of buttons

(.btn class)

  • Provide custom buttons.
    • If you provide your buttons in object options, you can define a
      class

      ,
      buttons: [
      { close: true, click: callback1, text: "btn-danger", style:
      "danger" },
      { close: true, click: callback2, text: "btn-info" style: "info" }, {
      close: true, click: callback3, text: "Other", style: " other" },
      //<- notice the space before
      { close: true, click: callback4, text: "CSS", css: {
      background-color: 'pink', color: 'blue' } }
      ],

Samuel Ribeiro Pinto

2016-01-25 13:50 GMT+00:00 spilxx [email protected]:

Thanks again for your help.

Another question:

How can I change the colour of the buttons?

I have by default:

Yes = blue
No = red

I need Yes = red

Thanks

var options = {
message: "Do you really want to delete this record?",
title: 'Confirmation',
size: eModal.size.sm,
label: 'Yes'
};

eModal.confirm(options).then(
    function(){ alert(1); },
    function(){ alert(2); }
    );


Reply to this email directly or view it on GitHub
#31 (comment).

from emodal.

saribe avatar saribe commented on August 31, 2024

[image: Imagem intercalada 2]

Samuel Ribeiro Pinto

2016-01-25 15:35 GMT+00:00 Samuel Pinto [email protected]:

Note: if the ACTION in use, already has buttons (e.g.: prompt), your
custom buttons will be addded on left, this will not replace the "native"
ones.

Samuel Ribeiro Pinto

2016-01-25 15:32 GMT+00:00 Samuel Pinto [email protected]:

You can do it in multiple ways:

  • Query DOM and change it.
    • When you execute eModal.ACTION, it returns a promise and in the
      promise object, you will find the modal's DOM element.

e.g.; var promise = eModal
.confirm("Hello")
.then(OKfn, KOfn);

    promise.element.find(".btn"); <- this wil return a list of

buttons (.btn class)

  • Provide custom buttons.
    • If you provide your buttons in object options, you can define a
      class

      ,
      buttons: [
      { close: true, click: callback1, text: "btn-danger", style:
      "danger" },
      { close: true, click: callback2, text: "btn-info" style: "info" }, {
      close: true, click: callback3, text: "Other", style: " other" },
      //<- notice the space before
      { close: true, click: callback4, text: "CSS", css: {
      background-color: 'pink', color: 'blue' } }
      ],

Samuel Ribeiro Pinto

2016-01-25 13:50 GMT+00:00 spilxx [email protected]:

Thanks again for your help.

Another question:

How can I change the colour of the buttons?

I have by default:

Yes = blue
No = red

I need Yes = red

Thanks

var options = {
message: "Do you really want to delete this record?",
title: 'Confirmation',
size: eModal.size.sm,
label: 'Yes'
};

eModal.confirm(options).then(
    function(){ alert(1); },
    function(){ alert(2); }
    );


Reply to this email directly or view it on GitHub
#31 (comment).

from emodal.

pbernim avatar pbernim commented on August 31, 2024

Hi Samuel,

Thanks again for your time & valuable help.

from emodal.

vijay1189 avatar vijay1189 commented on August 31, 2024

Hi saribe,
I am using eModal,
i had one issue, after turboboost transaction (on clicking on the turboboost link), emodal is not working,
i tried from even browser console also eModal.alert(''), but it didnt worked.
please can u help me on this.

Thanks

from emodal.

kidsonk avatar kidsonk commented on August 31, 2024

Am I being stupid but I cannot see any way to get the value that is typed into the prompt box. it has no id so I don't know how to reference it. Any help very much appreciated.
eModal.prompt(options)
.then(
function () { alert("?? PROMPT VALUE ???"); }
);

from emodal.

saribe avatar saribe commented on August 31, 2024

from emodal.

kidsonk avatar kidsonk commented on August 31, 2024

from emodal.

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.