Validate the state of the drawer children components.
()
| 1030 | |
| 1031 | /** Validate the state of the drawer children components. */ |
| 1032 | private _validateDrawers() { |
| 1033 | this._start = this._end = null; |
| 1034 | |
| 1035 | // Ensure that we have at most one start and one end drawer. |
| 1036 | this._drawers.forEach(drawer => { |
| 1037 | if (drawer.position == 'end') { |
| 1038 | if (this._end != null && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
| 1039 | throwMatDuplicatedDrawerError('end'); |
| 1040 | } |
| 1041 | this._end = drawer; |
| 1042 | } else { |
| 1043 | if (this._start != null && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
| 1044 | throwMatDuplicatedDrawerError('start'); |
| 1045 | } |
| 1046 | this._start = drawer; |
| 1047 | } |
| 1048 | }); |
| 1049 | |
| 1050 | this._right = this._left = null; |
| 1051 | |
| 1052 | // Detect if we're LTR or RTL. |
| 1053 | if (this._dir && this._dir.value === 'rtl') { |
| 1054 | this._left = this._end; |
| 1055 | this._right = this._start; |
| 1056 | } else { |
| 1057 | this._left = this._start; |
| 1058 | this._right = this._end; |
| 1059 | } |
| 1060 | } |
| 1061 | |
| 1062 | /** Whether the container is being pushed to the side by one of the drawers. */ |
| 1063 | private _isPushed() { |
no test coverage detected