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.
21 lines
589 B
JavaScript
21 lines
589 B
JavaScript
5 years ago
|
import { AutoloadPage } from 'vj/misc/PageLoader';
|
||
|
|
||
|
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;
|