Files
Hydro/packages/ui-default/components/form/textbox.page.ts
T
2021-10-10 16:27:23 +08:00

21 lines
583 B
TypeScript

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;