Skip to content

Commit

Permalink
Optimize project selector auto-switch script
Browse files Browse the repository at this point in the history
Simplify the jQuery code by making use of the affected elements' id
instead of a .children() call.
  • Loading branch information
dregad committed Sep 5, 2014
1 parent 19c494a commit fe078ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion javascript/common.js
Expand Up @@ -194,10 +194,13 @@ $(document).ready( function() {
$('[name=source_query_id]').change( function() {
$(this).parent().submit();
});
$('#project-selector').children('[name=project_id]').change( function() {

/* Project selector: auto-switch on select */
$('#form-set-project-id').change( function() {
$('#form-set-project').submit();
});
$('#project-selector').children('.button').hide();

setBugLabel();

$(document).on('click', 'input[type=checkbox]#use_date_filters', function() {
Expand Down

0 comments on commit fe078ef

Please sign in to comment.