summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/web/common_bug_modal.js
diff options
context:
space:
mode:
authorSebastin Santy <sebastinssanty@gmail.com>2017-06-21 22:01:16 +0200
committerDylan William Hardison <dylan@hardison.net>2017-06-21 22:01:16 +0200
commit5cff02a403a608775b3d7d93c4d1276c4b33631e (patch)
treeb096e68f32a4868e0409a297c2df60f8357c5fd3 /extensions/BugModal/web/common_bug_modal.js
parentf919fcc2d43006b4deebecbee8c572d510134620 (diff)
downloadbugzilla-5cff02a403a608775b3d7d93c4d1276c4b33631e.tar.gz
bugzilla-5cff02a403a608775b3d7d93c4d1276c4b33631e.tar.xz
Bug 1365344 - Extract the "status" and "null" modules (#101)
* Added comp_desc, ajax loading, modified rest * Make summary field long * Fixed indentations
Diffstat (limited to 'extensions/BugModal/web/common_bug_modal.js')
-rw-r--r--extensions/BugModal/web/common_bug_modal.js82
1 files changed, 0 insertions, 82 deletions
diff --git a/extensions/BugModal/web/common_bug_modal.js b/extensions/BugModal/web/common_bug_modal.js
index 3a5a149fb..1a2d309bb 100644
--- a/extensions/BugModal/web/common_bug_modal.js
+++ b/extensions/BugModal/web/common_bug_modal.js
@@ -1079,88 +1079,6 @@ $(function() {
$('#component, #version, #target_milestone').each(function() {
$(this).data('default', $(this).val());
});
- $('#product')
- .change(function(event) {
- $('#product-throbber').show();
- $('#component, #version, #target_milestone').attr('disabled', true);
-
- slide_module($('#module-tracking'), 'show');
-
- $.each($('input[name=groups]'), function() {
- if (this.checked) {
- slide_module($('#module-security'), 'show');
- return false;
- }
- });
-
- bugzilla_ajax(
- {
- url: 'rest/bug_modal/new_product/' + BUGZILLA.bug_id + '?product=' + encodeURIComponent($('#product').val())
- },
- function(data) {
- $('#product-throbber').hide();
- $('#component, #version, #target_milestone').attr('disabled', false);
- var is_default = $('#product').val() == $('#product').data('default');
-
- // populate selects
- $.each(data, function(key, value) {
- if (key == 'groups') return;
- var el = $('#' + key);
- if (!el) return;
- el.empty();
- var selected = el.data('preselect');
- $(value).each(function(i, v) {
- el.append($('<option>', { value: v.name, text: v.name }));
- if (typeof selected === 'undefined' && v.selected)
- selected = v.name;
- });
- el.val(selected);
- el.prop('required', true);
- if (is_default) {
- el.removeClass('attention');
- el.val(el.data('default'));
- }
- else {
- el.addClass('attention');
- }
- });
-
- // update groups
- var dirtyGroups = [];
- var any_groups_checked = 0;
- $('#module-security').find('input[name=groups]').each(function() {
- var that = $(this);
- var defaultChecked = !!that.attr('checked');
- if (defaultChecked !== that.is(':checked')) {
- dirtyGroups.push({ name: that.val(), value: that.is(':checked') });
- }
- if (that.is(':checked')) {
- any_groups_checked = 1;
- }
- });
- $('#module-security .module-content')
- .html(data.groups)
- .addClass('attention');
- $.each(dirtyGroups, function() {
- $('#module-security').find('input[value=' + this.name + ']').prop('checked', this.value);
- });
- // clear any default groups if user was making bug public
- // unless the group is mandatory for the new product
- if (!any_groups_checked) {
- $('#module-security').find('input[name=groups]').each(function() {
- var that = $(this);
- if (!that.data('mandatory')) {
- that.prop('checked', false);
- }
- });
- }
- },
- function() {
- $('#product-throbber').hide();
- $('#component, #version, #target_milestone').attr('disabled', false);
- }
- );
- });
// product/component search
$('#product-search')