Validate the state of the drawer children components.
()
| 1010 | |
| 1011 | /** Validate the state of the drawer children components. */ |
| 1012 | private _validateDrawers() { |
| 1013 | this._start = this._end = null; |
| 1014 | |
| 1015 | // Ensure that we have at most one start and one end drawer. |
| 1016 | this._drawers.forEach(drawer => { |
| 1017 | if (drawer.position == 'end') { |
| 1018 | if (this._end != null && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
| 1019 | throwMatDuplicatedDrawerError('end'); |
| 1020 | } |
| 1021 | this._end = drawer; |
| 1022 | } else { |
| 1023 | if (this._start != null && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
| 1024 | throwMatDuplicatedDrawerError('start'); |
| 1025 | } |
| 1026 | this._start = drawer; |
| 1027 | } |
| 1028 | }); |
| 1029 | |
| 1030 | this._right = this._left = null; |
| 1031 | |
| 1032 | // Detect if we're LTR or RTL. |
| 1033 | if (this._dir && this._dir.value === 'rtl') { |
| 1034 | this._left = this._end; |
| 1035 | this._right = this._start; |
| 1036 | } else { |
| 1037 | this._left = this._start; |
| 1038 | this._right = this._end; |
| 1039 | } |
| 1040 | } |
| 1041 | |
| 1042 | /** Whether the container is being pushed to the side by one of the drawers. */ |
| 1043 | private _isPushed() { |
no test coverage detected