mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
21 lines
583 B
TypeScript
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;
|