openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

jquery-plugin-orAutoheight.js (332B)


      1 import $ from "../jquery-global.js";
      2 
      3 /**
      4  * Input-Hints
      5  */
      6 export default function() {
      7 
      8 	let resize = function( element )
      9 	{
     10 		let lines = $(element).val().split("\n").length;
     11 		$(element).attr('rows',lines+3);
     12 	};
     13 	
     14 	$(this).each(function(i)
     15 	{
     16 		resize(this);
     17 	});
     18 
     19 	return $(this).keypress(function()
     20 	{
     21 		resize(this);
     22 	});
     23 };