@@ -84,7 +84,9 @@ const rippleFactory = (options = {}) => {
84
84
* @return {Object } Descriptor element including position and size of the element
85
85
*/
86
86
getDescriptor ( x , y ) {
87
- const { left, top, height, width } = ReactDOM . findDOMNode ( this ) . getBoundingClientRect ( ) ;
87
+ const {
88
+ left, top, height, width,
89
+ } = ReactDOM . findDOMNode ( this ) . getBoundingClientRect ( ) ;
88
90
const { rippleCentered : centered , rippleSpread : spread } = this . props ;
89
91
return {
90
92
left : centered ? 0 : x - left - ( width / 2 ) ,
@@ -152,15 +154,19 @@ const rippleFactory = (options = {}) => {
152
154
? this . getNextKey ( )
153
155
: this . getLastKey ( ) ;
154
156
const endRipple = this . addRippleDeactivateEventListener ( isTouch , key ) ;
155
- const initialState = { active : false , restarting : true , top, left, width, endRipple } ;
157
+ const initialState = {
158
+ active : false , restarting : true , top, left, width, endRipple,
159
+ } ;
156
160
const runningState = { active : true , restarting : false } ;
157
161
const ripples = { ...this . state . ripples , [ key ] : initialState } ;
158
162
this . setState ( { ripples } , ( ) => {
159
163
if ( this . rippleNodes [ key ] ) this . rippleNodes [ key ] . offsetWidth ; // eslint-disable-line
160
- this . setState ( { ripples : {
161
- ...this . state . ripples ,
162
- [ key ] : Object . assign ( { } , this . state . ripples [ key ] , runningState ) ,
163
- } } ) ;
164
+ this . setState ( {
165
+ ripples : {
166
+ ...this . state . ripples ,
167
+ [ key ] : Object . assign ( { } , this . state . ripples [ key ] , runningState ) ,
168
+ } ,
169
+ } ) ;
164
170
} ) ;
165
171
}
166
172
}
@@ -215,10 +221,12 @@ const rippleFactory = (options = {}) => {
215
221
const self = this ;
216
222
return function endRipple ( ) {
217
223
document . removeEventListener ( eventType , endRipple ) ;
218
- self . setState ( { ripples : {
219
- ...self . state . ripples ,
220
- [ rippleKey ] : Object . assign ( { } , self . state . ripples [ rippleKey ] , { active : false } ) ,
221
- } } ) ;
224
+ self . setState ( {
225
+ ripples : {
226
+ ...self . state . ripples ,
227
+ [ rippleKey ] : Object . assign ( { } , self . state . ripples [ rippleKey ] , { active : false } ) ,
228
+ } ,
229
+ } ) ;
222
230
} ;
223
231
}
224
232
@@ -240,7 +248,9 @@ const rippleFactory = (options = {}) => {
240
248
}
241
249
} ;
242
250
243
- renderRipple ( key , className , { active, left, restarting, top, width } ) {
251
+ renderRipple ( key , className , {
252
+ active, left, restarting, top, width,
253
+ } ) {
244
254
const scale = restarting ? 0 : 1 ;
245
255
const transform = `translate3d(${ ( - width / 2 ) + left } px, ${ ( - width / 2 ) + top } px, 0) scale(${ scale } )` ;
246
256
const _className = classnames ( this . props . theme . ripple , {
@@ -273,8 +283,7 @@ const rippleFactory = (options = {}) => {
273
283
} = this . props ;
274
284
const { ripples } = this . state ;
275
285
const childRipples = Object . keys ( ripples ) . map ( key =>
276
- this . renderRipple ( key , rippleClassName , ripples [ key ] ) ,
277
- ) ;
286
+ this . renderRipple ( key , rippleClassName , ripples [ key ] ) ) ;
278
287
const childProps = {
279
288
onMouseDown : this . handleMouseDown ,
280
289
onTouchStart : this . handleTouchStart ,
0 commit comments