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

Version Path
material_raingular-0.2.6 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.2.5 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.2.3.1 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.2.3 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.2.2 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.2.1 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.2 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.8.1 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.8 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.7 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.6.1 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.6.0 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.9 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.8.1 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.8 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.7 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.6 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.5 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.4 lib/assets/javascripts/directives/textarea.coffee
material_raingular-0.1.5.3 lib/assets/javascripts/directives/textarea.coffee