@@ -17,9 +17,6 @@ angular.module('monospaced.elastic', [])
1717
1818 return {
1919 require : 'ngModel' ,
20- scope :{
21- maxHeight :'='
22- } ,
2320 restrict : 'A, C' ,
2421 link : function ( scope , element , attrs , ngModel ) {
2522
@@ -72,7 +69,7 @@ angular.module('monospaced.elastic', [])
7269 minHeightValue = parseInt ( taStyle . getPropertyValue ( 'min-height' ) , 10 ) ,
7370 heightValue = parseInt ( taStyle . getPropertyValue ( 'height' ) , 10 ) ,
7471 minHeight = Math . max ( minHeightValue , heightValue ) - boxOuter . height ,
75- maxHeight = parseInt ( taStyle . getPropertyValue ( 'max-height' ) , 10 ) ,
72+ maxHeight = scope . maxHeight ? scope . maxHeight : parseInt ( taStyle . getPropertyValue ( 'max-height' ) , 10 ) ,
7673 mirrored ,
7774 active ,
7875 copyStyle = [ 'font-family' ,
@@ -192,6 +189,9 @@ angular.module('monospaced.elastic', [])
192189 $win . bind ( 'resize' , forceAdjust ) ;
193190
194191 scope . $watch ( function ( ) {
192+ if ( scope . maxHeight && scope . maxHeight != maxHeight ) {
193+ maxHeight = scope . maxHeight
194+ }
195195 return ngModel . $modelValue ;
196196 } , function ( newValue ) {
197197 forceAdjust ( ) ;
@@ -202,10 +202,6 @@ angular.module('monospaced.elastic', [])
202202 forceAdjust ( ) ;
203203 } ) ;
204204
205- scope . $watch ( 'maxHeight' , function ( n , o ) {
206- if ( n ) maxHeight = n ;
207- } ) ;
208-
209205 $timeout ( function ( ) { adjust } , 5000 ) ;
210206
211207 /*
0 commit comments