2727namespace app {
2828
2929 function initialize ( ) : void {
30- getElem ( "loading" ) . style . display = "none" ;
31- getElem ( "loaded" ) . style . removeProperty ( "display" ) ;
30+ getElem ( "loading" ) . hidden = true ;
31+ getElem ( "loaded" ) . hidden = false ;
3232 let elems = document . querySelectorAll ( "input[type=number], input[type=text], textarea" ) ;
3333 for ( let el of elems ) {
3434 if ( el . id . indexOf ( "version-" ) != 0 )
@@ -46,19 +46,18 @@ namespace app {
4646 const bitmapOutput : boolean = getInput ( "output-format-bitmap" ) . checked ;
4747 const scaleRow : HTMLElement = getElem ( "scale-row" ) ;
4848 let download = getElem ( "download" ) as HTMLAnchorElement ;
49+ scaleRow . hidden = ! bitmapOutput ;
4950 if ( bitmapOutput ) {
50- scaleRow . style . removeProperty ( "display" ) ;
5151 download . download = "qr-code.png" ;
5252 } else {
53- scaleRow . style . display = "none" ;
5453 download . download = "qr-code.svg" ;
5554 }
5655 download . removeAttribute ( "href" ) ;
5756
5857 // Reset output images in case of early termination
5958 const canvas = getElem ( "qrcode-canvas" ) as HTMLCanvasElement ;
6059 const svg = ( document . getElementById ( "qrcode-svg" ) as Element ) as SVGElement ;
61- canvas . style . display = "none" ;
60+ canvas . hidden = true ;
6261 svg . style . display = "none" ;
6362
6463 // Returns a QrCode.Ecc object based on the radio buttons in the HTML form.
@@ -94,7 +93,7 @@ namespace app {
9493 if ( scale <= 0 || scale > 30 )
9594 return ;
9695 drawCanvas ( qr , scale , border , lightColor , darkColor , canvas ) ;
97- canvas . style . removeProperty ( "display" ) ;
96+ canvas . hidden = false ;
9897 download . href = canvas . toDataURL ( "image/png" ) ;
9998 } else {
10099 const code : string = toSvgString ( qr , border , lightColor , darkColor ) ;
0 commit comments