sibanu_web/public/assets/js/components/custom/form-control.js

30 lines
372 B
JavaScript
Raw Normal View History

2022-08-20 13:21:23 +07:00
//
// Form control
//
'use strict';
var FormControl = (function() {
// Variables
var $input = $('.form-control');
// Methods
function init($this) {
$this.on('focus blur', function(e) {
$(this).parents('.form-group').toggleClass('focused', (e.type === 'focus'));
}).trigger('blur');
}
// Events
if ($input.length) {
init($input);
}
})();