Commit bfe0ace4 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 480061: Lots of JS was toggling the "display" attribute instead of…

Bug 480061: Lots of JS was toggling the "display" attribute instead of removing/adding the bz_default_hidden class. Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=glob, a=mkanat
parent ba04de6f
......@@ -20,12 +20,9 @@ function initChangeColumns() {
window.onunload = unload;
var av_select = document.getElementById("available_columns");
var sel_select = document.getElementById("selected_columns");
document.getElementById("avail_header").style.display = "inline";
document.getElementById("available_columns").style.display = "inline";
document.getElementById("select_button").style.display = "inline";
document.getElementById("deselect_button").style.display = "inline";
document.getElementById("up_button").style.display = "inline";
document.getElementById("down_button").style.display = "inline";
YAHOO.util.Dom.removeClass(
['avail_header', av_select, 'select_button',
'deselect_button', 'up_button', 'down_button'], 'bz_default_hidden');
switch_options(sel_select, av_select, false);
sel_select.selectedIndex = -1;
updateView();
......
......@@ -139,8 +139,8 @@ function updateCalendarFromField(date_field) {
/* Hide input fields and show the text with (edit) next to it */
function hideEditableField( container, input, action, field_id, original_value ) {
YAHOO.util.Dom.setStyle(container, 'display', 'inline');
YAHOO.util.Dom.setStyle(input, 'display', 'none');
YAHOO.util.Dom.removeClass(container, 'bz_default_hidden');
YAHOO.util.Dom.addClass(input, 'bz_default_hidden');
YAHOO.util.Event.addListener(action, 'click', showEditableField,
new Array(container, input));
if(field_id != ""){
......@@ -165,8 +165,8 @@ function showEditableField (e, ContainerInputArray) {
YAHOO.util.Event.preventDefault(e);
return;
}
YAHOO.util.Dom.setStyle(ContainerInputArray[0], 'display', 'none');
YAHOO.util.Dom.setStyle(inputArea, 'display', 'inline');
YAHOO.util.Dom.addClass(ContainerInputArray[0], 'bz_default_hidden');
YAHOO.util.Dom.removeClass(inputArea, 'bz_default_hidden');
if ( inputArea.tagName.toLowerCase() == "input" ) {
inputs.push(inputArea);
} else {
......@@ -212,8 +212,8 @@ function checkForChangedFieldValues(e, ContainerInputArray ) {
}
}
if(unhide){
YAHOO.util.Dom.setStyle(ContainerInputArray[0], 'display', 'none');
YAHOO.util.Dom.setStyle(ContainerInputArray[1], 'display', 'inline');
YAHOO.util.Dom.addClass(ContainerInputArray[0], 'bz_default_hidden');
YAHOO.util.Dom.removeClass(ContainerInputArray[1], 'bz_default_hidden');
}
}
......@@ -267,20 +267,25 @@ function showHideStatusItems(e, dupArrayInfo) {
// finish doing stuff based on the selection.
if ( el ) {
showDuplicateItem(el);
YAHOO.util.Dom.setStyle('resolution_settings', 'display', 'none');
YAHOO.util.Dom.addClass('resolution_settings', 'bz_default_hidden');
if (document.getElementById('resolution_settings_warning')) {
YAHOO.util.Dom.setStyle('resolution_settings_warning', 'display', 'none');
YAHOO.util.Dom.addClass('resolution_settings_warning',
'bz_default_hidden');
}
YAHOO.util.Dom.setStyle('duplicate_display', 'display', 'none');
YAHOO.util.Dom.addClass('duplicate_display', 'bz_default_hidden');
if ( el.value == dupArrayInfo[1] && dupArrayInfo[0] == "is_duplicate" ) {
YAHOO.util.Dom.setStyle('resolution_settings', 'display', 'inline');
YAHOO.util.Dom.setStyle('resolution_settings_warning', 'display', 'block');
YAHOO.util.Dom.removeClass('resolution_settings',
'bz_default_hidden');
YAHOO.util.Dom.removeClass('resolution_settings_warning',
'bz_default_hidden');
}
else if ( bz_isValueInArray(close_status_array, el.value) ) {
// hide duplicate and show resolution
YAHOO.util.Dom.setStyle('resolution_settings', 'display', 'inline');
YAHOO.util.Dom.setStyle('resolution_settings_warning', 'display', 'block');
YAHOO.util.Dom.removeClass('resolution_settings',
'bz_default_hidden');
YAHOO.util.Dom.removeClass('resolution_settings_warning',
'bz_default_hidden');
}
}
}
......@@ -292,14 +297,16 @@ function showDuplicateItem(e) {
if (resolution) {
if (resolution.value == 'DUPLICATE' && bz_isValueInArray( close_status_array, bug_status.value) ) {
// hide resolution show duplicate
YAHOO.util.Dom.setStyle('duplicate_settings', 'display', 'inline');
YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'none');
YAHOO.util.Dom.removeClass('duplicate_settings',
'bz_default_hidden');
YAHOO.util.Dom.addClass('dup_id_discoverable', 'bz_default_hidden');
dup_id.focus();
dup_id.select();
}
else {
YAHOO.util.Dom.setStyle('duplicate_settings', 'display', 'none');
YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'block');
YAHOO.util.Dom.addClass('duplicate_settings', 'bz_default_hidden');
YAHOO.util.Dom.removeClass('dup_id_discoverable',
'bz_default_hidden');
dup_id.blur();
}
}
......@@ -309,7 +316,7 @@ function showDuplicateItem(e) {
function setResolutionToDuplicate(e, duplicate_or_move_bug_status) {
var status = document.getElementById('bug_status');
var resolution = document.getElementById('resolution');
YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'none');
YAHOO.util.Dom.addClass('dup_id_discoverable', 'bz_default_hidden');
status.value = duplicate_or_move_bug_status;
resolution.value = "DUPLICATE";
showHideStatusItems("", ["",""]);
......
......@@ -501,7 +501,6 @@ form#Create .comment {
background-repeat: no-repeat;
background-position: center center;
width: 30px;
display: none;
}
#select_button {
......
......@@ -103,7 +103,7 @@
<script type="text/javascript">
var close_status_array = new Array("[% closed_status_array.join('", "') FILTER replace(',$', '')
FILTER none %]");
YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'block');
YAHOO.util.Dom.removeClass('dup_id_discoverable', 'bz_default_hidden');
hideEditableField( "dup_id_container", "dup_id", 'dup_id_edit_action',
'dup_id', '[% bug.dup_id FILTER js %]' )
showHideStatusItems( "", ['[% "is_duplicate" IF bug.dup_id %]',
......
......@@ -56,11 +56,11 @@
</select>
</td>
<td>
<input class="image_button" type="button" id="select_button"
name="select" onclick="move_select()">
<input class="image_button bz_default_hidden" type="button"
id="select_button" name="select" onclick="move_select()">
<br><br>
<input class="image_button" type="button" id="deselect_button"
name="deselect" onclick="move_deselect()">
<input class="image_button bz_default_hidden" type="button"
id="deselect_button" name="deselect" onclick="move_deselect()">
</td>
<td>
<select name="selected_columns" id="selected_columns"
......@@ -80,11 +80,11 @@
</select>
</td>
<td>
<input class="image_button" type="button" id="up_button"
name="up" onclick="move_up()">
<input class="image_button bz_default_hidden" type="button"
id="up_button" name="up" onclick="move_up()">
<br><br>
<input class="image_button" type="button" id="down_button"
name="down" onclick="move_down()">
<input class="image_button bz_default_hidden" type="button"
id="down_button" name="down" onclick="move_down()">
</td>
</tr>
</table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment