How do I trigger Ratchet's push manually?

339 Views Asked by At

I have a link which makes a search. So far, it's working. The issue is when I want the search to be done through hiting the 'enter' button. So:

   $('#searchedText').on('keypress', function(e) {
    console.log("writed");
    if ($(this).val().trim().length > 2) {
      if (e.which == 13) {
        console.log("Passed condition");
        app.search = $('#searchedText').val();
        // HERE'S WHERE I NEED TO TRIGGER RATCHET's PUSH
      }
    }
  });

I tried to change window.location - Doesn't work I tried to trigger tap & click event - Doesn't work

Any ideas?

Thanks in advance.

1

There are 1 best solutions below

0
jgauna On

If anyone needs a solution for this, I finally found on the Ratchet's issues (github). If you wanna trigger a custom push, just do:

PUSH({url: 'YourUrl+hash', transition: 'slide-out'});

Regards