Coder Social home page Coder Social logo

bootstrap.alert's People

Contributors

bherbulot avatar lcognat avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bherbulot

bootstrap.alert's Issues

Option "click_outside_for_close" make the modal immediatly disappear

When I use the pugin with the following options, the modal immediatly disappear when it should be displayed.

In HTML :

<div class="spot></div>

In Javascript file

$(document).ready(function(){
    $('.spot').click(function(event){
      var button = $(event.currentTarget);
      var stand_number = button.data("number");
      $.alert({
        title: '', 
        body: "Vous avez choisi le numéro " + stand_number, 
        is_delayed: false,
        close_after_calback_confirm: true,
        close_after_calback_decline: true,
        text_confirm: 'OK',
        text_decline: 'Close',
        click_outside_for_close: false,
        timer_modal: 50,
      });
    });
});

Improvment : Add a listener to a certain class to create confirmable link

It would be nice to have a listener to a certain class to create confirmable link:
for example:

<script type="text/javascript">
$('.bootstrap-alert-confirmable').click(function(event){
  var message = $(this).data('message');
  var dest = event.target.href;
  event.preventDefault();
  $.alert({
    text_confirm: 'oui',
    text_decline: "annuler",
    click_outside_for_close: false,
    title: 'Êtes-vous sûr(e) ?',
    body: message + '<br>Êtes-vous sûr(e) ?',
    callback_confirm: function(){
      window.location = dest;
    },
    is_delayed: false,
  });
});
</script>

and in the page (DOM)

<a class="btn btn-danger bootstrap-alert-confirmable" data-message="This will cancel things." href=scheme://path/to/final/link">Cancel</a>

Could it be more simple to chain alerts

Currently, to chain alerts I use the following code :

    callback_confirm: function(){
          // display other modal
          setTimeout(function(){
            $.alert({
              title: "",
              body:"Vous réserver l'emplacement... Vous voulez réserver autre emplacements?",
              is_delayed: false,
              text_confirm: 'Finaliser et payer',
              text_decline: 'Réserver autre emplacement',
              callback_confirm: function(){
                window.location.href = "http://127.0.0.1:5000/payment/";
              },
            });
          },1000); 
        },

Could it be more simple to use ?

Improve guntfile

The gruntifle has no minify target, we should add it. The dist folder contains unnecessary files.

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.