@@ -327,40 +327,37 @@ var RoomSubList = React.createClass({
327327 } ,
328328
329329 calcManualOrderTagData : function ( room ) {
330- var index = this . state . sortedList . indexOf ( room ) ;
330+ const index = this . state . sortedList . indexOf ( room ) ;
331331
332332 // we sort rooms by the lexicographic ordering of the 'order' metadata on their tags.
333333 // for convenience, we calculate this for now a floating point number between 0.0 and 1.0.
334334
335- var orderA = 0.0 ; // by default we're next to the beginning of the list
335+ let orderA = 0.0 ; // by default we're next to the beginning of the list
336336 if ( index > 0 ) {
337- var prevTag = this . state . sortedList [ index - 1 ] . tags [ this . props . tagName ] ;
337+ const prevTag = this . state . sortedList [ index - 1 ] . tags [ this . props . tagName ] ;
338338 if ( ! prevTag ) {
339- console . error ( "Previous room in sublist is not tagged to be in this list. This should never happen." )
340- }
341- else if ( prevTag . order === undefined ) {
339+ console . error ( "Previous room in sublist is not tagged to be in this list. This should never happen." ) ;
340+ } else if ( prevTag . order === undefined ) {
342341 console . error ( "Previous room in sublist has no ordering metadata. This should never happen." ) ;
343- }
344- else {
342+ } else {
345343 orderA = prevTag . order ;
346344 }
347345 }
348346
349- var orderB = 1.0 ; // by default we're next to the end of the list too
347+ let orderB = 1.0 ; // by default we're next to the end of the list too
350348 if ( index < this . state . sortedList . length - 1 ) {
351- var nextTag = this . state . sortedList [ index + 1 ] . tags [ this . props . tagName ] ;
349+ const nextTag = this . state . sortedList [ index + 1 ] . tags [ this . props . tagName ] ;
352350 if ( ! nextTag ) {
353- console . error ( "Next room in sublist is not tagged to be in this list. This should never happen." )
354- }
355- else if ( nextTag . order === undefined ) {
351+ console . error ( "Next room in sublist is not tagged to be in this list. This should never happen." ) ;
352+ } else if ( nextTag . order === undefined ) {
356353 console . error ( "Next room in sublist has no ordering metadata. This should never happen." ) ;
357- }
358- else {
354+ } else {
359355 orderB = nextTag . order ;
360356 }
361357 }
362358
363- var order = ( orderA + orderB ) / 2.0 ;
359+ const order = ( orderA + orderB ) / 2.0 ;
360+
364361 if ( order === orderA || order === orderB ) {
365362 console . error ( "Cannot describe new list position. This should be incredibly unlikely." ) ;
366363 // TODO: renumber the list
0 commit comments