* Updates the dialog's position. * @param position New dialog position.
(position?: DialogPosition)
| 195 | * @param position New dialog position. |
| 196 | */ |
| 197 | updatePosition(position?: DialogPosition): this { |
| 198 | let strategy = this._ref.config.positionStrategy as GlobalPositionStrategy; |
| 199 | |
| 200 | if (position && (position.left || position.right)) { |
| 201 | position.left ? strategy.left(position.left) : strategy.right(position.right); |
| 202 | } else { |
| 203 | strategy.centerHorizontally(); |
| 204 | } |
| 205 | |
| 206 | if (position && (position.top || position.bottom)) { |
| 207 | position.top ? strategy.top(position.top) : strategy.bottom(position.bottom); |
| 208 | } else { |
| 209 | strategy.centerVertically(); |
| 210 | } |
| 211 | |
| 212 | this._ref.updatePosition(); |
| 213 | |
| 214 | return this; |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * Updates the dialog's width and height. |
no test coverage detected