@@ -11,12 +11,10 @@ export default class Image extends CloudinaryComponent {
1111 }
1212
1313 super ( props , context ) ;
14- let options = CloudinaryComponent . normalizeOptions ( context , props ) ;
1514 this . handleResize = this . handleResize . bind ( this ) ;
1615
1716 let state = { responsive : false , url : "" , breakpoints : defaultBreakpoints } ;
1817 this . state = Object . assign ( state , this . prepareState ( props , context ) ) ;
19- this . state = state ;
2018 }
2119
2220 get window ( ) {
@@ -47,12 +45,7 @@ export default class Image extends CloudinaryComponent {
4745 return state ;
4846 }
4947
50- componentWillMount ( ) {
51- super . componentWillMount ( ) ;
52- }
53-
5448 componentDidMount ( ) {
55- super . componentDidMount ( ) ;
5649 // now that we have a this.element, we need to calculate the URL
5750 let state = this . prepareState ( ) ;
5851 if ( state . url !== undefined ) {
@@ -80,13 +73,6 @@ export default class Image extends CloudinaryComponent {
8073 }
8174 }
8275
83- componentDidUpdate ( prevProps , prevState , prevContext ) {
84- }
85-
86- shouldComponentUpdate ( nextProps , nextState , nextContext ) {
87- return true ;
88- }
89-
9076 handleResize ( e ) {
9177 let options = CloudinaryComponent . normalizeOptions ( this . context , this . props ) ;
9278 let url = this . getUrl ( options ) ;
@@ -123,18 +109,18 @@ export default class Image extends CloudinaryComponent {
123109 return containerWidth ;
124110 } ;
125111
126- applyBreakpoints ( tag , width , steps , options ) {
112+ applyBreakpoints ( width , steps , options ) {
127113 var responsive_use_breakpoints ;
128114 options = CloudinaryComponent . normalizeOptions ( this . context , this . props , options ) ;
129115 responsive_use_breakpoints = options . responsiveUseBreakpoints ;
130116 if ( ( ! responsive_use_breakpoints ) || ( responsive_use_breakpoints === 'resize' && ! options . resizing ) ) {
131117 return width ;
132118 } else {
133- return this . calc_breakpoint ( tag , width , steps ) ;
119+ return this . calc_breakpoint ( width , steps ) ;
134120 }
135121 } ;
136122
137- calc_breakpoint ( element , width , steps ) {
123+ calc_breakpoint ( width , steps ) {
138124 var breakpoints , point ;
139125 breakpoints = this . state . breakpoints || defaultBreakpoints ;
140126 if ( Util . isFunction ( breakpoints ) ) {
@@ -200,7 +186,7 @@ export default class Image extends CloudinaryComponent {
200186 resultUrl = resultUrl . replace ( / w _ a u t o : b r e a k p o i n t s ( [ _ 0 - 9 ] * ) ( : [ 0 - 9 ] + ) ? / ,
201187 "w_auto:breakpoints$1:" + requiredWidth ) ;
202188 } else if ( match = / w _ a u t o ( : ( \d + ) ) ? / . exec ( resultUrl ) ) {
203- requiredWidth = this . applyBreakpoints ( this . element , containerWidth , match [ 2 ] , options ) ;
189+ requiredWidth = this . applyBreakpoints ( containerWidth , match [ 2 ] , options ) ;
204190 requiredWidth = this . maxWidth ( requiredWidth , this . element ) ;
205191 resultUrl = resultUrl . replace ( / w _ a u t o [ ^ , \/ ] * / g, "w_" + requiredWidth ) ;
206192 }
0 commit comments