3
3
4
4
import etch from 'etch' ;
5
5
import { prewalk , postwalk , prefor } from './tree.js' ;
6
- import { Etch , Tip , Button , toView } from '../util/etch.js' ;
6
+ import { Etch , Button , toView } from '../util/etch.js' ;
7
7
8
8
function clamp ( x , min , max ) {
9
9
return Math . min ( Math . max ( x , min ) , max )
@@ -26,12 +26,12 @@ function dims(tree) {
26
26
left += ch . width ;
27
27
} ) ;
28
28
// Centre align children
29
- chwidth = parent . children . map ( ( { width} ) => width ) . reduce ( ( a , b ) => a + b , 0 ) ;
29
+ const chwidth = parent . children . map ( ( { width} ) => width ) . reduce ( ( a , b ) => a + b , 0 ) ;
30
30
parent . children . forEach ( ch => ch . left += ( parent . width - chwidth ) / 2 ) ;
31
31
return parent ;
32
32
} ) ;
33
33
// Scale total height to 100%
34
- let max = postwalk ( tree , ( { height, children} ) =>
34
+ const max = postwalk ( tree , ( { height, children} ) =>
35
35
Math . max ( height , ...children . map ( x => x + height ) ) ) ;
36
36
prewalk ( tree , ( node ) => {
37
37
node . top /= max ;
@@ -172,7 +172,7 @@ export class Pannable extends Etch {
172
172
this . toolbar = this . toolbar . concat ( this . item . toolbar )
173
173
}
174
174
175
- let style = { position :'relative' , height :'inherit' , width :'inherit' , transformOrigin : '0px 0px' }
175
+ const style = { position :'relative' , height :'inherit' , width :'inherit' , transformOrigin : '0px 0px' }
176
176
177
177
if ( this . zoomstrategy == 'width' ) {
178
178
style . transform = 'translate(' + this . left + 'px,' + this . top + 'px)'
0 commit comments