summaryrefslogtreecommitdiffstats
path: root/extensions/Review/web/js
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-07-31 16:08:20 +0200
committerByron Jones <bjones@mozilla.com>2013-07-31 16:08:20 +0200
commit0d71c225256de0a0e4f96e33c314efdab032f83f (patch)
tree1f41be4dfa7a69d970a74cf5aad00ae05a89ffff /extensions/Review/web/js
parent94a7eb66783db51f8a50426edbd542b5d2132ea8 (diff)
downloadbugzilla-0d71c225256de0a0e4f96e33c314efdab032f83f.tar.gz
bugzilla-0d71c225256de0a0e4f96e33c314efdab032f83f.tar.xz
Bug 899974: Patch checkbox gets unchecked when picking a patch
Diffstat (limited to 'extensions/Review/web/js')
-rw-r--r--extensions/Review/web/js/review.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/extensions/Review/web/js/review.js b/extensions/Review/web/js/review.js
index 3ba00487d..0dedd2410 100644
--- a/extensions/Review/web/js/review.js
+++ b/extensions/Review/web/js/review.js
@@ -13,6 +13,8 @@ var REVIEW = {
target: false,
fields: [],
use_error_for: false,
+ ispatch_override: false,
+ description_override: false,
init_review_flag: function(fid, flag_name) {
var idx = this.fields.push({ 'fid': fid, 'flag_name': flag_name, 'component': '' }) - 1;
@@ -44,6 +46,8 @@ var REVIEW = {
init_create_attachment: function() {
Event.addListener('data', 'change', REVIEW.attachment_change);
+ Event.addListener('description', 'change', REVIEW.description_change);
+ Event.addListener('ispatch', 'change', REVIEW.ispatch_change);
},
component_change: function() {
@@ -55,16 +59,26 @@ var REVIEW = {
attachment_change: function() {
var filename = Dom.get('data').value.split('/').pop().split('\\').pop();
var description = Dom.get('description');
- if (description.value == '') {
+ if (description.value == '' || !REVIEW.description_override) {
description.value = filename;
}
- Dom.get('ispatch').checked =
- REVIEW.endsWith(filename, '.diff') || REVIEW.endsWith(filename, '.patch');
- bz_fireEvent(Dom.get('ispatch'), 'change');
+ if (!REVIEW.ispatch_override) {
+ Dom.get('ispatch').checked =
+ REVIEW.endsWith(filename, '.diff') || REVIEW.endsWith(filename, '.patch');
+ }
+ setContentTypeDisabledState(this.form);
description.select();
description.focus();
},
+ description_change: function() {
+ REVIEW.description_override = true;
+ },
+
+ ispatch_change: function() {
+ REVIEW.ispatch_override = true;
+ },
+
flag_change: function(e, field_idx) {
var field = REVIEW.fields[field_idx];
var suggestions_span = Dom.get(field.fid + '_suggestions');