Bug 129375 cd /home/akrasilnikov/web_root/bug3/trunk/js

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1792 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
akrasilnikov 2013-09-12 11:02:55 +00:00
parent 5af8b603ed
commit 8c0e2adf1c
1 changed files with 15 additions and 4 deletions

View File

@ -328,7 +328,14 @@ function search_filter_click(e, el)
var field_current_value = document.getElementById(field_name).value; var field_current_value = document.getElementById(field_name).value;
if (field_current_value == '') if (field_current_value == '')
{ {
e.preventDefault(); if (preventDefault && e.preventDefault)
{
e.preventDefault();
}
else
{
return false;
}
alert('Field must be filled!'); alert('Field must be filled!');
} }
var href_parts = href.split('&' + field_name + '='); var href_parts = href.split('&' + field_name + '=');
@ -336,7 +343,7 @@ function search_filter_click(e, el)
el.href = new_href; el.href = new_href;
} }
window.onload = function() { addListener(window, 'load', function() {
if (document.getElementById('form_bug_edit')) if (document.getElementById('form_bug_edit'))
{ {
var testCl = new RegExp("\\bsearch-link\\b"); var testCl = new RegExp("\\bsearch-link\\b");
@ -345,10 +352,14 @@ window.onload = function() {
var length = all.length; var length = all.length;
for (var i = 0; i < length; i++) { for (var i = 0; i < length; i++) {
if (testCl.test(all[i].className)) { if (testCl.test(all[i].className)) {
(function(i) { addListener(all[i], 'click', function (e) { return search_filter_click(e, all[i]); }); })(i); (function(i) {
addListener(i, 'click', function (e) {
return search_filter_click(e, i);
});
})(all[i]);
} }
} }
} }
}; });