diff options
author | Kohei Yoshino <kohei.yoshino@gmail.com> | 2018-08-10 14:56:19 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-08-10 14:56:19 +0200 |
commit | 5a43b27f7940be9697f312c550fa2de11a9e14d7 (patch) | |
tree | 9e6e91abf14d1052366b8815b0fa63f4a0655372 /extensions/Review/web/js | |
parent | 1f35e100eaab5776633a3b995f3c32a0438f6e86 (diff) | |
download | bugzilla-5a43b27f7940be9697f312c550fa2de11a9e14d7.tar.gz bugzilla-5a43b27f7940be9697f312c550fa2de11a9e14d7.tar.xz |
Bug 602313 - Allow creation of attachments by pasting an image from clipboard, as well as by drag-and-dropping a file from desktop
Diffstat (limited to 'extensions/Review/web/js')
-rw-r--r-- | extensions/Review/web/js/review.js | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/extensions/Review/web/js/review.js b/extensions/Review/web/js/review.js index 0163ceba6..b07ce9d75 100644 --- a/extensions/Review/web/js/review.js +++ b/extensions/Review/web/js/review.js @@ -10,9 +10,6 @@ var REVIEW = { target: false, fields: [], use_error_for: false, - ispatch_override: false, - description_override: false, - ignore_patch_event: true, init_review_flag: function(fid, flag_name) { var idx = this.fields.push({ 'fid': fid, 'flag_name': flag_name, 'component': '' }) - 1; @@ -39,13 +36,6 @@ var REVIEW = { $('#component').on('change', REVIEW.component_change); BUGZILLA.string['reviewer_required'] = 'A reviewer is required.'; this.use_error_for = true; - this.init_create_attachment(); - }, - - init_create_attachment: function() { - $('#data').on('change', REVIEW.attachment_change); - $('#description').on('change', REVIEW.description_change); - $('#ispatch').on('change', REVIEW.ispatch_change); }, component_change: function() { @@ -54,36 +44,6 @@ var REVIEW = { } }, - attachment_change: function() { - var filename = $('#data').val().split('/').pop().split('\\').pop(); - var description = $('#description').first(); - if (description.val() == '' || !REVIEW.description_override) { - description.val(filename); - } - if (!REVIEW.ispatch_override) { - $('#ispatch').prop('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() { - // the attachment template triggers this change event onload - // as we only want to set ispatch_override when the user clicks on the - // checkbox, we ignore this first event - if (REVIEW.ignore_patch_event) { - REVIEW.ignore_patch_event = false; - return; - } - REVIEW.ispatch_override = true; - }, - flag_change: function(e) { var field = REVIEW.fields[e.data]; var suggestions_span = $('#' + field.fid + '_suggestions'); @@ -167,8 +127,8 @@ var REVIEW = { }, check_mandatory: function(e) { - if ($('#data').length && !$('#data').val() - && $('#attach_text').length && !$('#attach_text').val()) + if ($('#file').length && !$('#file').val() + && $('#att-textarea').length && !$('#att-textarea').val()) { return; } |