Creates an element that will be shown instead of the current element while dragging.
()
| 1220 | |
| 1221 | /** Creates an element that will be shown instead of the current element while dragging. */ |
| 1222 | private _createPlaceholderElement(): HTMLElement { |
| 1223 | const placeholderConfig = this._placeholderTemplate; |
| 1224 | const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null; |
| 1225 | let placeholder: HTMLElement; |
| 1226 | |
| 1227 | if (placeholderTemplate) { |
| 1228 | this._placeholderRef = placeholderConfig!.viewContainer.createEmbeddedView( |
| 1229 | placeholderTemplate, |
| 1230 | placeholderConfig!.context, |
| 1231 | ); |
| 1232 | this._placeholderRef.detectChanges(); |
| 1233 | placeholder = getRootNode(this._placeholderRef, this._document); |
| 1234 | } else { |
| 1235 | placeholder = deepCloneNode(this._rootElement); |
| 1236 | } |
| 1237 | |
| 1238 | // Stop pointer events on the preview so the user can't |
| 1239 | // interact with it while the preview is animating. |
| 1240 | placeholder.style.pointerEvents = 'none'; |
| 1241 | placeholder.classList.add(PLACEHOLDER_CLASS); |
| 1242 | return placeholder; |
| 1243 | } |
| 1244 | |
| 1245 | /** |
| 1246 | * Figures out the coordinates at which an element was picked up. |
no test coverage detected