summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-02-25 23:39:00 +0100
committermkanat%bugzilla.org <>2009-02-25 23:39:00 +0100
commitbfe0ace45de808021bf13e7aa4c2a6b52147a67c (patch)
treead6e54b8335c702dcdcc8da9905bcacd6cf5c0dc
parentba04de6f7d1ad111b61e492f5af9c0fd6145d08d (diff)
downloadbugzilla-bfe0ace45de808021bf13e7aa4c2a6b52147a67c.tar.gz
bugzilla-bfe0ace45de808021bf13e7aa4c2a6b52147a67c.tar.xz
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
-rw-r--r--js/change-columns.js9
-rw-r--r--js/field.js43
-rw-r--r--skins/standard/global.css1
-rw-r--r--template/en/default/bug/knob.html.tmpl2
-rw-r--r--template/en/default/list/change-columns.html.tmpl16
5 files changed, 37 insertions, 34 deletions
diff --git a/js/change-columns.js b/js/change-columns.js
index 5fd5c1085..e70cfd560 100644
--- a/js/change-columns.js
+++ b/js/change-columns.js
@@ -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();
diff --git a/js/field.js b/js/field.js
index e8442e964..629fb8a23 100644
--- a/js/field.js
+++ b/js/field.js
@@ -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("", ["",""]);
diff --git a/skins/standard/global.css b/skins/standard/global.css
index 75dc437d3..a18378d4b 100644
--- a/skins/standard/global.css
+++ b/skins/standard/global.css
@@ -501,7 +501,6 @@ form#Create .comment {
background-repeat: no-repeat;
background-position: center center;
width: 30px;
- display: none;
}
#select_button {
diff --git a/template/en/default/bug/knob.html.tmpl b/template/en/default/bug/knob.html.tmpl
index f08b9e2b1..49eb254c7 100644
--- a/template/en/default/bug/knob.html.tmpl
+++ b/template/en/default/bug/knob.html.tmpl
@@ -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 %]',
diff --git a/template/en/default/list/change-columns.html.tmpl b/template/en/default/list/change-columns.html.tmpl
index 2e51851a9..36cd5dbb8 100644
--- a/template/en/default/list/change-columns.html.tmpl
+++ b/template/en/default/list/change-columns.html.tmpl
@@ -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>