a little js cleanup
This commit is contained in:
parent
858c9b2eeb
commit
2cc94ba296
@ -15,8 +15,5 @@
|
||||
//= require turbolinks
|
||||
//= require modernizr-lite/modernizr
|
||||
|
||||
//= require ajax-links
|
||||
|
||||
//= require forms/button-group
|
||||
//= require forms/animations
|
||||
//= require forms/textarea-limit
|
||||
//= require main/ajax-links
|
||||
//= require main/textarea-limit
|
||||
|
@ -1,30 +0,0 @@
|
||||
var $textInput = $('[type="color"], [type="date"], [type="datetime"], [type="datetime-local"], [type="email"], [type="month"], [type="number"], [type="password"], [type="search"], [type="tel"], [type="text"], [type="time"], [type="url"], [type="week"], input:not([type]), textarea');
|
||||
|
||||
// Text Input Label Animation
|
||||
$textInput.prev('label').addClass('loaded');
|
||||
$textInput.each(function() {
|
||||
if( $(this).val() ) {
|
||||
$(this).prev('label').addClass('animate');
|
||||
}
|
||||
});
|
||||
|
||||
$textInput.on('focus', function() {
|
||||
$(this).prev('label').addClass('animate');
|
||||
}).on('focusout', function() {
|
||||
if( !$(this).val() ) {
|
||||
$(this).prev('label').removeClass('animate');
|
||||
}
|
||||
});
|
||||
|
||||
// form error resolutions
|
||||
$('form').has('.error').each(function(){
|
||||
var $form = $(this);
|
||||
|
||||
$form.on('keyup', $textInput, function(){
|
||||
$form.find(".error").addClass('resolve-error');
|
||||
});
|
||||
|
||||
$form.on('change', $("[type=radio], [type=checkbox]"), function(){
|
||||
$form.find(".error").addClass('resolve-error');
|
||||
});
|
||||
});
|
@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Button Group Functionality
|
||||
*/
|
||||
|
||||
$('.btn-group button').click(function() {
|
||||
$(this).siblings().removeClass('selected');
|
||||
$(this).addClass('selected');
|
||||
});
|
Loading…
Reference in New Issue
Block a user