[openstreetmap/openstreetmap-website] Lessen code repetition (PR #5633)
Holger Jeromin
notifications at github.com
Sat Feb 8 19:36:08 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);
But I would remove jQuery in the long run. But that es probably only me :)
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5633#discussion_r1947934981
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5633/review/2604013541 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250208/d5c00476/attachment.htm>
More information about the rails-dev
mailing list