Commit Graph

7 Commits

Author SHA1 Message Date
Javi Martín
7b96180a76 Upgrade Turbolinks to version 5.2.1
We didn't upgrade Turbolinks when we upgraded to Rails 5 so we didn't
upgrade too many things at the same time, and postponed it... until now
:).

Note upgrading Turbolinks fixes an issue with foundation's sticky when
using the browser's back and forward buttons. We're adding tests for
these scenarios.

Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
2020-08-05 14:10:22 +02:00
Javi Martín
017eeda3d4 Remove redundant call to $(document).ready()
The `$()` function is a shortcut for `$(document).ready()`, and we were
attaching events to `$(document).ready()` inside the `$()` function.

In a similar way, we were handling the `page:load` and `ajax:complete`
events inside the `$()` function. But when those events trigger, the DOM
is already ready.

Besides, we don't have to wait for the DOM to be ready before attaching
events to the `document` element. Quoting jQuery's `.on()`
documentation:

> The document element is available in the head of the document before
> loading any other HTML, so it is safe to attach events there without
> waiting for the document to be ready.

Co-Authored-By: Senén Rodero Rodríguez <senenrodero@gmail.com>
2020-08-05 11:34:57 +02:00
Javi Martín
5211f47842 Add and apply ESLint spacing rules
For now we're only adding rules related to spacing and double quotes,
following the same rules we use in Ruby, which are the same rules
CoffeeScript followed when compiling these files.

We're also using the recommended ESLint rules, which will warn us about
many JavaScript common pitfalls, the `strict` rule which enforces using
strict mode, and the `no-console` rule, which will prevent us from
shipping code meant for debugging.

Although it's arguably more common to use the JSON format to define
these rules, I've chosen YAML because it's the format we use in all our
linters.
2019-09-11 14:03:24 +02:00
Javi Martín
86e704d8a4 Use strict mode in JavaScript
Strict mode is supported by 98% of the browsers, including Internet
Explorer 10, and it helps developers avoid common JavaScript pitfalls.
2019-09-11 03:14:17 +02:00
Julian Herrero
d9eaea4ea0 Use double quotes in app/assets 2019-03-15 09:26:00 +01:00
Juanjo Bazán
2cddad22d6 redux admin for spending proposals
adds dossier info
adds assignments to admin and valuators
2016-02-24 19:39:02 +01:00
Juanjo Bazán
8c99c6a5f0 refactors stats and optimizes js
JS libraries for stats (d3, c3, etc.) only load now when needed (stats/show)
2015-09-23 19:37:24 +02:00