Split 90-custom into 90-autoresize and 90-themes
[gruntmaster-page.git] / js / 90-autoresize.js
diff --git a/js/90-autoresize.js b/js/90-autoresize.js
new file mode 100644 (file)
index 0000000..e40ef4e
--- /dev/null
@@ -0,0 +1,20 @@
+(function(){
+       'use strict';
+
+       $( document ).ready(function() {
+               var hiddenDiv = $(document.createElement('div'));
+
+               hiddenDiv.addClass('hiddendiv common');
+
+               $('body').append(hiddenDiv);
+
+               $("textarea.autoresize").on('keyup', function () {
+                       var content = $(this).val();
+
+                       content = content.replace(/\n/g, '<br>');
+                       hiddenDiv.html(content + '<br class="lbr">');
+
+                       $(this).css('height', hiddenDiv.height()+23);
+               });
+       });
+})();
This page took 0.009567 seconds and 4 git commands to generate.