Vova Yatsyuk
Vova Yatsyuk
@juandavm, meanwhile, I recommend creating cash-extends.js file with all new methods you need. Here is a scrollTop implementation: ```js $.fn.scrollTop = function (val) { var el = this.get(0); if (val...
Ah, yes.. Fixed now. I hope :) Thank you. p.s. Fixed one more time.🤫
https://codepen.io/vovayatsyuk/pen/dyOVzPE?editors=1011 - I don't know how to easily see the double submit. I've opened the network panel in the Chrome dev toolbar and watched for all post requests. I've added...
Here is how jquery do the trick: ```js $j(document).on('submit', function (event) {}); // listens to native js 'submit' events $form.submit(); // doesn't trigger native event. ``` The way the first...
Since jquery is not firing the native event, the turbo doesn't submit this form via ajax. I can do the same with cash and `data-turbo=false` on a form. Here is...
Not sure if anybody needs this, but I ended up with the following code. > It submits the form with turbo via ajax if possible: ```js $.fn.submit = function ()...
I don’t think it’s a bug. jQuery uses custom events while cash uses native events (turbo listens to them). This is the reason of different results.
My [codepen](https://codepen.io/vovayatsyuk/pen/dyOVzPE?editors=1011) is messed up a bit, but try to make the console panel a little bigger and you'll see that when pressing "Submit form with cash" button an event...
Just updated this library and found that the previous solution posted by @fideloper doesn't work anymore. Here is an updated class for version 3.2.0 in case somebody will need it...