Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show actions only on success (ajax) #111

Open
misner opened this issue Jun 6, 2016 · 0 comments
Open

How to show actions only on success (ajax) #111

misner opened this issue Jun 6, 2016 · 0 comments

Comments

@misner
Copy link

misner commented Jun 6, 2016

On my app, when user sees the modal, he first sees 'loading' while the app gathers something we call the Result.

Then if ajax returns a 'success', I want to show 2 action buttons ('get more details about result') and 'go back to next result')

var msg;
msg = Messenger().run({
  action: $.ajax,
  progressMessage:  'Loading the RESULT...',
  successMessage:  'This is the Result : %{results  and all}',
   actions: {
      getMoreDetails: {
        label: "give me details on the provided result",
        action: function() {
          ....//do stuff
        }
      },
      goToNextResult: {
        label: 'Move To Next Result',
        action: function(){
         //do stuff
        }       
      }
    }
});

The problem today is that the app shows the 2 action buttons ('get more details' and 'move to next result' ) while showing 'loading', that is to say before even showing to the user the result.

Is it possible to tell Hubspot Messenger to only show the actions when the 'success' ajax message appears ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant