pebble / clay

Pebble Config Framework
MIT License
120 stars 29 forks source link

Cancel/Discard changes button #135

Closed amenychtas closed 7 years ago

amenychtas commented 7 years ago

Is possible to use the generic button to cancel/discard changes? What is the recommended approach on this?

keegan-lillo commented 7 years ago

yup.

In your custom function:

module.exports = function(minified) {
  var clayConfig = this;

  clayConfig.on(clayConfig.EVENTS.AFTER_BUILD, function() {
    clayConfig.getItemById('cancel-btn').on('click', function() {
      document.location.href = window.returnTo;
    });
  });
};
amenychtas commented 7 years ago

Great! Many thanks! 👍