dist/buttons/buttonApply.command.js
/**
   * Get and handle response
   * Use the global Mautic functions
   *
   * @param editor
   * @param sender
   * @param response
   */
Get and handle response
Use the global Mautic functions


Get and handle response Use the global Mautic functions
static postFormResponse(editor, sender, response) {
    const mauticForm = ButtonsService.getMauticForm();
    if (response.validationError !== null) {
      const title = Mautic.translate('grapesjsbuilder.panelsViewsCommandModalTitleError');
      ButtonApplyCommand.showModal(editor, title, response.validationError);
    } else {
      if (response.route) {
        MauticVars.manualStateChange = false;
        History.pushState(null, 'Mautic', response.route); 
        Mautic.generatePageTitle(response.route);
      } 
      if (ButtonsService.strcmp(mauticForm[0].baseURI, mauticForm[0].action) !== 0) {
        mauticForm[0].action = mauticForm[0].baseURI;
      }
    }
    sender.set('className', 'fa fa-check');
  }
static postFormResponse ( editor , sender , response ) { const mauticForm = ButtonsService . getMauticForm ( ) ; if ( response . validationError !== null ) { const title = Mautic . translate ( 'grapesjsbuilder.panelsViewsCommandModalTitleError' ) ; ButtonApplyCommand . showModal ( editor , title , response . validationError ) ; } else { if ( response . route ) { MauticVars . manualStateChange = false ; History . pushState ( null , 'Mautic' , response . route ) ; Mautic . generatePageTitle ( response . route ) ; } if ( ButtonsService . strcmp ( mauticForm [ 0 ] . baseURI , mauticForm [ 0 ] . action ) !== 0 ) { mauticForm [ 0 ] . action = mauticForm [ 0 ] . baseURI ; } } sender . set ( 'className' , 'fa fa-check' ) ; }
Get and handle response
 Use the global Mautic functions
Get and handle response Use the global Mautic functions
// update URL in address bar // update Title // update form action