a little js cleanup

This commit is contained in:
Mark Moser 2017-03-06 16:31:00 -06:00
parent 858c9b2eeb
commit 2cc94ba296
5 changed files with 2 additions and 43 deletions

View File

@ -15,8 +15,5 @@
//= require turbolinks //= require turbolinks
//= require modernizr-lite/modernizr //= require modernizr-lite/modernizr
//= require ajax-links //= require main/ajax-links
//= require main/textarea-limit
//= require forms/button-group
//= require forms/animations
//= require forms/textarea-limit

View File

@ -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');
});
});

View File

@ -1,8 +0,0 @@
/**
* Button Group Functionality
*/
$('.btn-group button').click(function() {
$(this).siblings().removeClass('selected');
$(this).addClass('selected');
});