Skip to content

Commit

Permalink
Fixed up my magical boolean conversion. Whoops.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmalonenz committed Apr 27, 2016
1 parent 558d7f8 commit 27cebfc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/dragula-and-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class DragulaAndDrop {
ignoreInputTextSelection: this._convertToBooleanIfRequired(this._getOption('ignoreInputTextSelection')),
mirrorContainer: this._getOption('mirrorContainer')
};

return result;
}

Expand All @@ -137,6 +138,6 @@ export class DragulaAndDrop {
if (typeof option === 'string') {
return option.toLowerCase() === 'true';
}
return new Boolean(option);
return new Boolean(option).valueOf();
}
}
2 changes: 1 addition & 1 deletion src/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
12 changes: 0 additions & 12 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/dragulaanddrop.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 27cebfc

Please sign in to comment.