Sha256: bde72435ad3de11ed7e48793e01263db52dbb54cbf192652907e91de476fe0bb
Contents?: true
Size: 760 Bytes
Versions: 83
Compression:
Stored size: 760 Bytes
Contents
angular.module('TextArea', []) .directive 'textarea', ($timeout) -> restrict: 'E' link: (scope, element, attributes) -> return if element.hasClass('static') initialHeight = initialHeight || element[0].style.height element.css('resize','none').css('overflow','hidden').css('border','0px') initial = element.parent().css('height') resize = -> element.parent().css('height',element.parent()[0].offsetHeight) if element.parent()[0] element[0].style.height = initialHeight element[0].style.height = "" + Math.max(20,element[0].scrollHeight) + "px" $timeout -> element.parent().css('height',initial) element.on("blur keyup change focus input", resize) $timeout(resize, 0)
Version data entries
83 entries across 83 versions & 1 rubygems