|
195 | 195 | $.bug.current_step('details'); |
196 | 196 | } |
197 | 197 | element.show(); |
| 198 | + // Start by hiding the end-of-life message. |
| 199 | + var uv_element = $('.state_details .unsupported-versions'); |
| 200 | + uv_element.hide(); |
| 201 | + |
| 202 | + // Grab the list of unsupported versions and stuff the |
| 203 | + // versions into an array. |
| 204 | + var uv_array = new Array(); |
| 205 | + |
| 206 | + /* -- I can't seem to get the file to load properly, so I'll |
| 207 | + -- just hard-code the values for now. |
| 208 | + var jqxhr = $.get("unsupported-versions/file/here", function(data){ |
| 209 | + //uv_array = data.split("\n"); |
| 210 | + console.log("Something...here "); |
| 211 | + //console.log(uv_array); |
| 212 | + }) |
| 213 | + .done(function() { console.log("done here..."); }) |
| 214 | + .fail(function() { console.log("GET failed"); }); |
| 215 | + */ |
| 216 | + uv_array = ["3.5 all versions", "3.4 all versions", "3.3 all versions"]; |
| 217 | + |
198 | 218 | $('.active_subcomponent .select', element).select(); |
199 | 219 | $('.active_subcomponent .select .choice', element).click(function() { |
200 | 220 | $.bug.refresh_related_bugs(); |
|
205 | 225 | }); |
206 | 226 | $(".select", element).select(); |
207 | 227 | $(".state_details .versions .choice[data='NONE']").remove(); |
| 228 | + // When the user selects a version in the drop-down box, |
| 229 | + // run this function. |
208 | 230 | $(".versions .select .choice", element).click(function() { |
209 | 231 | $.bug.lo_version = $('.state_details .versions .chosen').attr('data'); |
210 | 232 | $.bug.lo_version_id = $('.state_details .versions .chosen').attr('idvalue'); |
211 | | - if ($.bug.sub_component != 'EMPTY' && $.bug.op_sys != '' && $.bug.regression != '') { |
212 | | - $.bug.state_description(); |
| 233 | + if ($.bug.sub_component != 'EMPTY' && |
| 234 | + $.bug.op_sys != '' && |
| 235 | + $.bug.regression != '') { |
| 236 | + $.bug.state_description(); |
213 | 237 | } |
| 238 | + |
| 239 | + // If this version is unsupported, display a warning |
| 240 | + // message. |
| 241 | + if($.inArray($.bug.lo_version, uv_array) >= 0) { |
| 242 | + uv_element.show(); |
| 243 | + } else { |
| 244 | + uv_element.hide(); |
| 245 | + } |
214 | 246 | }); |
215 | 247 | $(".select", element).select(); |
216 | 248 | $(".op_sys .select .choice", element).click(function() { |
|
0 commit comments