github sweetalert2/sweetalert2 v1.0.0
Promise instead of callback.

latest releases: v11.10.8, v11.10.7, v11.10.6...
8 years ago

Breaking changes in 1.0.0

1. Promise instead of callback.

Before 1.0.0 callback function was used to handle the result of modal dialog:

swal(
  {title: 'Are you sure?', showCancelButton: true}, 
  function(isConfirm) {
    ...
  }
);

Starting with v1.0.0 promise should be used instead of the callback:

swal({title: 'Are you sure?', showCancelButton: true}).then(
  function(isConfirm) {
    ...
  }
);

isConfirm is:

  • true for confirm button
  • false for calcel button
  • undefined for outside click or if modal was closed by timer

2. IE is not supported by default

To enable IE10+ support, include es6-promise:

<script src="bower_components/es6-promise/promise.min.js"></script>

Don't miss a new sweetalert2 release

NewReleases is sending notifications on new releases.