Commit Graph

6 Commits

Author SHA1 Message Date
Javi Martín
0270c4c962 Hide unsaved changes warning after undoing them
This way showing the warning is consistent with warning users when
they're leaving the page.
2020-08-05 14:10:22 +02:00
Javi Martín
f8c9f09887 Prevent default event on JavaScript-only links
These links point to "#" and don't do anything without JavaScript
activated, and they were causing the browser to scroll to the top of the
page.
2020-08-05 14:10:22 +02:00
Javi Martín
d61e8cb6a6 Use text() instead of html()
Using html() makes it possible to insert <script> tags in the DOM, and
in this case we aren't supposed to be inserting any HTML.

I haven't found a way to focus on a field with Capybara, then add a
character, and focus on another field. So I've manually triggered the
change event in the test.
2019-10-21 20:24:50 +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
ec5af1f1bc Remove unnecessary return statements
These statements were automatically added by CoffeeScript.

I'm only removing the obvious cases; there might be more cases where the
`return` statement isn't necessary.
2019-09-11 14:03:24 +02:00
Javi Martín
d93a029ce5 Convert CofeeScript to JavaScript
Compiled using `coffee -c` with CoffeeScript 1.12.6.
2019-09-11 14:03:24 +02:00