diff --git a/src/dragula-and-drop.js b/src/dragula-and-drop.js index 4eea5a0..d94ddb9 100644 --- a/src/dragula-and-drop.js +++ b/src/dragula-and-drop.js @@ -120,6 +120,7 @@ export class DragulaAndDrop { ignoreInputTextSelection: this._convertToBooleanIfRequired(this._getOption('ignoreInputTextSelection')), mirrorContainer: this._getOption('mirrorContainer') }; + return result; } @@ -137,6 +138,6 @@ export class DragulaAndDrop { if (typeof option === 'string') { return option.toLowerCase() === 'true'; } - return new Boolean(option); + return new Boolean(option).valueOf(); } } diff --git a/src/dragula.js b/src/dragula.js index 6b5c012..d68e66f 100644 --- a/src/dragula.js +++ b/src/dragula.js @@ -441,7 +441,7 @@ export class Dragula { if (this._mirror) { classes.rm(this.options.mirrorContainer, 'gu-unselectable'); touchy(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag); - Util.remove(this._mirror); + Util.getParent(this._mirror).removeChild(this._mirror); this._mirror = null; } } diff --git a/src/util.js b/src/util.js index c248d04..2c672cb 100644 --- a/src/util.js +++ b/src/util.js @@ -99,18 +99,6 @@ class _Util { return immediate; } - remove(node) { - if (node) { - if (!('remove' in Element.prototype)) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } - } else { - node.remove(); - } - } - } - getViewModel(element) { if (element && element.au) { if (element.au.controller.viewModel.currentViewModel) diff --git a/test/unit/dragulaanddrop.spec.js b/test/unit/dragulaanddrop.spec.js index 5b8070c..3fab7e8 100644 --- a/test/unit/dragulaanddrop.spec.js +++ b/test/unit/dragulaanddrop.spec.js @@ -82,7 +82,7 @@ describe('the Dragula and Drop Custom Element', function() { this.dragulaAndDrop.dragula.options.isContainer(this.container); //assert - expect(isBoolean).toBeTruthy(); + expect(isBoolean).toBeFalsy(); }); it('should check copy-option correctly (function)', function() {