| 115 | } |
| 116 | |
| 117 | setFrameDim() { |
| 118 | let {width, height} = this.pgpElement.getBoundingClientRect(); |
| 119 | if (!height) { |
| 120 | return; |
| 121 | } |
| 122 | if (this.dDialog === null) { |
| 123 | if (!width) { // if no message contents |
| 124 | width = 500; |
| 125 | } |
| 126 | this.eFrame.style.width = `${width}px`; |
| 127 | this.eFrame.style.height = `${height}px`; |
| 128 | } else { |
| 129 | let {width} = this.pgpElement.parentElement.getBoundingClientRect(); |
| 130 | if (!width) { |
| 131 | return; |
| 132 | } |
| 133 | // less 1px border and 2 pixel box-shadow |
| 134 | width -= 3; |
| 135 | this.eFrame.style.width = `${width}px`; |
| 136 | this.eFrame.style.height = `${height}px`; |
| 137 | // set absolute dims for performance reasons |
| 138 | this.dDialog.style.width = `${width}px`; |
| 139 | this.dDialog.style.height = `${height}px`; |
| 140 | } |
| 141 | } |
| 142 | } |