MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / _createHelper

Method _createHelper

src/dd-draggable.ts:317–329  ·  view source on GitHub ↗

@internal create a clone copy (or user defined method) of the original drag item if set

()

Source from the content-addressed store, hash-verified

315
316 /** @internal create a clone copy (or user defined method) of the original drag item if set */
317 protected _createHelper(): HTMLElement {
318 let helper = this.el;
319 if (typeof this.option.helper === 'function') {
320 helper = this.option.helper(this.el);
321 } else if (this.option.helper === 'clone') {
322 helper = Utils.cloneNode(this.el);
323 }
324 if (!helper.parentElement) {
325 Utils.appendTo(helper, this.option.appendTo === 'parent' ? this.el.parentElement : this.option.appendTo);
326 }
327 this.dragElementOriginStyle = DDDraggable.originStyleProp.map(prop => this.el.style[prop]);
328 return helper;
329 }
330
331 /** @internal set the fix position of the dragged item */
332 protected _setupHelperStyle(e: DragEvent): DDDraggable {

Callers 1

_mouseMoveMethod · 0.95

Calls 2

cloneNodeMethod · 0.80
appendToMethod · 0.80

Tested by

no test coverage detected