@internal create a clone copy (or user defined method) of the original drag item if set
()
| 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 { |
no test coverage detected