You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/packages/ui-default/components/form/textbox.page.js

21 lines
583 B
JavaScript

import { AutoloadPage } from 'vj/misc/Page';
const textboxPage = new AutoloadPage('textboxPage', () => {
$(document).on('focusin', '.textbox.material input', (ev) => {
$(ev.currentTarget).parent().addClass('focus');
});
$(document).on('focusout', '.textbox.material input', (ev) => {
$(ev.currentTarget).parent().removeClass('focus');
});
const $focusElement = $(document.activeElement);
if ($focusElement.prop('tagName') === 'INPUT'
&& $focusElement.parent().is('.textbox.material')
) {
$focusElement.focusin();
}
});
export default textboxPage;