diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 199376b..8dbf4d2 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -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 diff --git a/app/assets/javascripts/forms/animations.js b/app/assets/javascripts/forms/animations.js deleted file mode 100644 index a920c94..0000000 --- a/app/assets/javascripts/forms/animations.js +++ /dev/null @@ -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'); - }); -}); diff --git a/app/assets/javascripts/forms/button-group.js b/app/assets/javascripts/forms/button-group.js deleted file mode 100644 index bea798c..0000000 --- a/app/assets/javascripts/forms/button-group.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Button Group Functionality - */ - -$('.btn-group button').click(function() { - $(this).siblings().removeClass('selected'); - $(this).addClass('selected'); -}); diff --git a/app/assets/javascripts/ajax-links.js b/app/assets/javascripts/main/ajax-links.js similarity index 100% rename from app/assets/javascripts/ajax-links.js rename to app/assets/javascripts/main/ajax-links.js diff --git a/app/assets/javascripts/forms/textarea-limit.js b/app/assets/javascripts/main/textarea-limit.js similarity index 100% rename from app/assets/javascripts/forms/textarea-limit.js rename to app/assets/javascripts/main/textarea-limit.js