Code Monkey home page Code Monkey logo

Comments (9)

IfnotFr avatar IfnotFr commented on August 15, 2024

Interesting behaviour proposal.

Guys, please +1 this feature if you are interested.

from popconfirm.

ramnzys avatar ramnzys commented on August 15, 2024

Hi there... I currently have this:

<a  class="trash-key"
  href="#"
  data-post-url="...some url ... "
  data-confirm-title="Are you sure?"
  data-confirm-content="About to delete key <strong>{{$key}}</strong> from database."
  data-confirm-placement="top"
  data-confirm-container="body"
  data-confirm-yesBtn="Ok, delete!"
  data-confirm-noBtn="No"
  > <i class="fa fa-trash fa-lg" aria-hidden="true"></i>
</a>
$('a.trash-key').click(function (e){
  var row = $(this).closest('tr');
  var url = $(this).data('post-url');
  var id = row.attr('id');
  $.post( url, {id: id}, function(){
    row.remove();
    } );
    return false;
});

$("a.trash-key").popConfirm();

The javascript is executed ONLY if I click the yesBtn.

from popconfirm.

IfnotFr avatar IfnotFr commented on August 15, 2024

@RamonZayas this behaviour is normal, this it the main goal of the plugin : to queue an action of a button and execute it with a confirmation on the YES button.

from popconfirm.

ramnzys avatar ramnzys commented on August 15, 2024

I know, but that is exactly what @ivanoronee is asking for... am I right?... or is this something completely different? what am I missing?.

from popconfirm.

IfnotFr avatar IfnotFr commented on August 15, 2024

I thinks it is different.

Can you explain your case with more precision ?

from popconfirm.

atxulo avatar atxulo commented on August 15, 2024

Isn't this solved with #33?

Maybe it's just a matter of documentation. It isn´t clear that when you click the 'Yes' button, the original click handler is called

from popconfirm.

IfnotFr avatar IfnotFr commented on August 15, 2024

This plugin is an "Simple action confirmation plugin".

So, it ask a confirmation before doing an action, and do the action only if we click yes.

@EnekoGB : do you think the "action confirmation" is too ambigous ? Should i add a example ? (like a confirm() in javascript ?)

from popconfirm.

atxulo avatar atxulo commented on August 15, 2024

@ifnot When i read the doc the first time, it wasn't clear to me, maybe because i had used @tavicu bs-confirmation, which has an onConfirm callback.

I realized how this plugin works only when I checked the fiddle demo.

Maybe a little change in README.md like #34 whould make it clearer.

from popconfirm.

IfnotFr avatar IfnotFr commented on August 15, 2024

I have merged the example.

I need some docs update as the action can be manual.

I will work on it when i have the time :)

from popconfirm.

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.