Skip to content

Custom action callbacks

Maciek Jurczyk edited this page Feb 17, 2016 · 4 revisions

User can specify custom javascript code which will be executed on cancel or confirm action using confirmAction or cancelAction.

var modal = new pathfora.Message({
  layout: 'modal',
  msg: 'Click either button to trigger the callback.',

  confirmAction: {
    name: 'Modal Confirm button',
    callback: function() { 
      console.log('Confirm button clicked.');
    }
  },

  cancelAction: {
    name: 'Modal Cancel button',
    callback: function() { 
      console.log('Cancel button clicked.');
    }
  }
});