Module: common/confirm-dialog-sk

confirm-dialog-sk

This element pops up a dialog with OK and Cancel buttons. Its open method returns a Promise which will resolve when the user clicks OK or reject when the user clicks Cancel.

Source:
Example
<confirm-dialog-sk id="confirm_dialog"></confirm-dialog-sk>

<script>
  (function(){
    $('#confirm-dialog').open("Proceed with taking over the world?").then(() => {
      // Do some thing on confirm.
    }).catch(() => {
      // Do some thing on cancel.
    });
  })();
</script>

Methods

open(message) → {Promise}

Display the dialog.
Parameters:
Name Type Description
message string Message to display. Text only, any markup will be escaped.
Source:
Returns:
Returns a Promise that resolves on OK, and rejects on Cancel.
Type
Promise