| Total Complexity | 3 |
| Complexity/F | 1 |
| Lines of Code | 17 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /* |
||
| 24 | app.directive('elastic', [ |
||
| 25 | '$timeout', |
||
| 26 | function($timeout) { |
||
| 27 | return { |
||
| 28 | restrict: 'A', |
||
| 29 | link: function($scope, element) { |
||
| 30 | $scope.initialHeight = $scope.initialHeight || element[0].style.height; |
||
| 31 | var resize = function() { |
||
| 32 | element[0].style.height = $scope.initialHeight; |
||
| 33 | element[0].style.height = "" + element[0].scrollHeight + "px"; |
||
| 34 | }; |
||
| 35 | element.on("input change", resize); |
||
| 36 | $timeout(resize, 0); |
||
| 37 | } |
||
| 38 | }; |
||
| 39 | } |
||
| 40 | ]); |