Skip to content

Commit

Permalink
Remove unused util $.fn.focusNextInputField (#9180)
Browse files Browse the repository at this point in the history
  • Loading branch information
RayBB authored May 20, 2024
1 parent 4ffbd9f commit b2f5505
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion openlibrary/plugins/openlibrary/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import init from './ol.js';
import * as Browser from './Browser';
import { commify, urlencode, slice } from './python';
import Template from './template.js';
// Add $.fn.focusNextInputField
import { truncate, cond } from './utils';
import initValidate from './validate';
import '../../../../static/css/js-all.less';
Expand Down
16 changes: 5 additions & 11 deletions openlibrary/plugins/openlibrary/js/utils.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
// http://jqueryminute.com/set-focus-to-the-next-input-field-with-jquery/
$.fn.focusNextInputField = function() {
return this.each(function() {
var fields = $(this).parents('form').eq(0).add('body').find(':input:visible');
var index = fields.index(this);
if (index > -1 && (index + 1) < fields.length) {
fields.eq(index + 1).focus();
}
return false;
});
};
/*
These functions are used by jsdef.py
They must be available in the global JS namespace
See: https://github.com/internetarchive/openlibrary/pull/9180#issuecomment-2107911798
*/

// closes active popup
export function closePopup() {
Expand Down

0 comments on commit b2f5505

Please sign in to comment.