[openstreetmap/openstreetmap-website] Lessen code repetition (PR #5633)
Holger Jeromin
notifications at github.com
Sat Feb 8 19:32:11 UTC 2025
@HolgerJeromin commented on this pull request.
> @@ -61,13 +61,9 @@ OSM.Changeset = function (map) {
});
content.find("textarea").on("input", function (e) {
- var form = e.target.form;
-
- if ($(e.target).val() === "") {
- $(form.comment).prop("disabled", true);
- } else {
- $(form.comment).prop("disabled", false);
- }
+ const form = e.target.form,
+ disabled = $(e.target).val() === "";
+ $(form.comment).prop("disabled", disabled);
```suggestion
form.comment.disabled = disabled;
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5633#pullrequestreview-2604013043
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5633/review/2604013043 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250208/e08e4dff/attachment-0001.htm>
More information about the rails-dev
mailing list