Skip to content

Commit

Permalink
Use placeholder attribute instead of Javascript for bug jump feature
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhicks committed Aug 20, 2011
1 parent 73b9fb4 commit 430bec7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion application/core/html_api.php
Expand Up @@ -859,7 +859,7 @@ function print_menu() {

$t_bug_label = lang_get( 'issue_id' );
echo '<input type="hidden" name="bug_label" value="', $t_bug_label, '" />';
echo '<input type="text" name="bug_id" size="10" class="small" />&#160;';
echo '<input type="text" name="bug_id" size="10" class="small" placeholder="' . lang_get( 'issue_id' ) . '" />&#160;';

echo '<input type="submit" class="button-small" value="' . lang_get( 'jump' ) . '" />&#160;';
echo '</fieldset>';
Expand Down
24 changes: 0 additions & 24 deletions public/javascript/common.js
Expand Up @@ -177,28 +177,13 @@ $(document).ready( function() {
});


$('.bug-jump').find('[name=bug_id]').focus( function() {
var bug_label = $('.bug-jump-form').find('[name=bug_label]').val();
if( $(this).val() == bug_label ) {
$(this).val('');
$(this).removeClass('field-default');
}
});
$('.bug-jump').find('[name=bug_id]').blur( function() {
var bug_label = $('.bug-jump-form').find('[name=bug_label]').val();
if( $(this).val() == '' ) {
$(this).val(bug_label);
$(this).addClass('field-default');
}
});
$('[name=source_query_id]').change( function() {
$(this).parent().submit();
});
$('#project-selector').children('[name=project_id]').change( function() {
$('#form-set-project').submit();
});
$('#project-selector').children('.button').hide();
setBugLabel();

$('input[type=checkbox]#use_date_filters').live('click', function() {
if (!$(this).is(':checked')) {
Expand Down Expand Up @@ -246,15 +231,6 @@ $(document).ready( function() {
});
});

function setBugLabel() {
var bug_label = $('.bug-jump-form').find('[name=bug_label]').val();
var field = $('.bug-jump').find('[name=bug_id]');
if( field.val() == '' ) {
field.val(bug_label);
field.addClass('field-default');
}
}

/*
* String manipulation
*/
Expand Down

0 comments on commit 430bec7

Please sign in to comment.