]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1580980 - Including "patch" in attachment description automatically flags the...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Fri, 11 Oct 2019 15:17:05 +0000 (11:17 -0400)
committerdklawren <dklawren@users.noreply.github.com>
Fri, 11 Oct 2019 15:17:05 +0000 (11:17 -0400)
js/attachment.js

index 414d6754aef9ab38019bb8d43c1337468063d458..de2f89089f7bac1073ea1482b5b3ede79f18c433 100644 (file)
@@ -698,8 +698,10 @@ Bugzilla.AttachmentForm = class AttachmentForm {
    * Called whenever the Description is updated. Update the Patch checkbox when needed.
    */
   description_oninput() {
-    if (this.$description.value.match(/\bpatch\b/i) && !this.$ispatch.checked) {
-      this.update_ispatch(true);
+    const is_patch = !!this.$description.value.match(/^patch\b/i);
+
+    if (is_patch !== this.$ispatch.checked) {
+      this.update_ispatch(is_patch);
     }
   }