Skip to content

Commit

Permalink
v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmalonenz committed Dec 2, 2018
1 parent f324e1c commit 40970a1
Show file tree
Hide file tree
Showing 6 changed files with 2,013 additions and 1,926 deletions.
16 changes: 14 additions & 2 deletions dist/amd/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u
};
};

Dragula.prototype._cloneNodeWithoutCheckedRadios = function _cloneNodeWithoutCheckedRadios(el) {
var mirror = el.cloneNode(true);
var mirrorInputs = mirror.getElementsByTagName('input');
var len = mirrorInputs.length;
for (var i = 0; i < len; i++) {
if (mirrorInputs[i].type === 'radio') {
mirrorInputs[i].checked = false;
}
}
return mirror;
};

Dragula.prototype.manualStart = function manualStart(item) {
var context = this._canStart(item);
if (context) {
Expand All @@ -246,7 +258,7 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u

Dragula.prototype.start = function start(context) {
if (this._isCopy(context.item, context.source)) {
this._copy = context.item.cloneNode(true);
this._copy = this._cloneNodeWithoutCheckedRadios(context.item);
this._emitter.emit('cloned', this._copy, context.item, 'copy', _util.Util.getViewModel(context.item));
}

Expand Down Expand Up @@ -489,7 +501,7 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u
return;
}
var rect = this._item.getBoundingClientRect();
this._mirror = this._item.cloneNode(true);
this._mirror = this._cloneNodeWithoutCheckedRadios(this._item);
this._mirror.style.width = _util.Util.getRectWidth(rect) + 'px';
this._mirror.style.height = _util.Util.getRectHeight(rect) + 'px';
classes.rm(this._mirror, 'gu-transit');
Expand Down
16 changes: 14 additions & 2 deletions dist/aurelia-dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,18 @@ export class Dragula {
}
}

_cloneNodeWithoutCheckedRadios(el) {
var mirror = el.cloneNode(true);
var mirrorInputs = mirror.getElementsByTagName('input');
var len = mirrorInputs.length;
for (var i = 0; i < len; i++) {
if (mirrorInputs[i].type === 'radio') {
mirrorInputs[i].checked = false;
}
}
return mirror;
}

manualStart (item) {
let context = this._canStart(item)
if (context) {
Expand All @@ -406,7 +418,7 @@ export class Dragula {

start (context) {
if (this._isCopy(context.item, context.source)) {
this._copy = context.item.cloneNode(true)
this._copy = this._cloneNodeWithoutCheckedRadios(context.item)
this._emitter.emit('cloned', this._copy, context.item, 'copy', Util.getViewModel(context.item))
}

Expand Down Expand Up @@ -638,7 +650,7 @@ export class Dragula {
return
}
let rect = this._item.getBoundingClientRect()
this._mirror = this._item.cloneNode(true)
this._mirror = this._cloneNodeWithoutCheckedRadios(this._item)
this._mirror.style.width = Util.getRectWidth(rect) + 'px'
this._mirror.style.height = Util.getRectHeight(rect) + 'px'
classes.rm(this._mirror, 'gu-transit')
Expand Down
16 changes: 14 additions & 2 deletions dist/commonjs/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ var Dragula = exports.Dragula = function () {
};
};

Dragula.prototype._cloneNodeWithoutCheckedRadios = function _cloneNodeWithoutCheckedRadios(el) {
var mirror = el.cloneNode(true);
var mirrorInputs = mirror.getElementsByTagName('input');
var len = mirrorInputs.length;
for (var i = 0; i < len; i++) {
if (mirrorInputs[i].type === 'radio') {
mirrorInputs[i].checked = false;
}
}
return mirror;
};

Dragula.prototype.manualStart = function manualStart(item) {
var context = this._canStart(item);
if (context) {
Expand All @@ -218,7 +230,7 @@ var Dragula = exports.Dragula = function () {

Dragula.prototype.start = function start(context) {
if (this._isCopy(context.item, context.source)) {
this._copy = context.item.cloneNode(true);
this._copy = this._cloneNodeWithoutCheckedRadios(context.item);
this._emitter.emit('cloned', this._copy, context.item, 'copy', _util.Util.getViewModel(context.item));
}

Expand Down Expand Up @@ -461,7 +473,7 @@ var Dragula = exports.Dragula = function () {
return;
}
var rect = this._item.getBoundingClientRect();
this._mirror = this._item.cloneNode(true);
this._mirror = this._cloneNodeWithoutCheckedRadios(this._item);
this._mirror.style.width = _util.Util.getRectWidth(rect) + 'px';
this._mirror.style.height = _util.Util.getRectHeight(rect) + 'px';
classes.rm(this._mirror, 'gu-transit');
Expand Down
16 changes: 14 additions & 2 deletions dist/system/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,18 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti
};
};

Dragula.prototype._cloneNodeWithoutCheckedRadios = function _cloneNodeWithoutCheckedRadios(el) {
var mirror = el.cloneNode(true);
var mirrorInputs = mirror.getElementsByTagName('input');
var len = mirrorInputs.length;
for (var i = 0; i < len; i++) {
if (mirrorInputs[i].type === 'radio') {
mirrorInputs[i].checked = false;
}
}
return mirror;
};

Dragula.prototype.manualStart = function manualStart(item) {
var context = this._canStart(item);
if (context) {
Expand All @@ -241,7 +253,7 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti

Dragula.prototype.start = function start(context) {
if (this._isCopy(context.item, context.source)) {
this._copy = context.item.cloneNode(true);
this._copy = this._cloneNodeWithoutCheckedRadios(context.item);
this._emitter.emit('cloned', this._copy, context.item, 'copy', Util.getViewModel(context.item));
}

Expand Down Expand Up @@ -484,7 +496,7 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti
return;
}
var rect = this._item.getBoundingClientRect();
this._mirror = this._item.cloneNode(true);
this._mirror = this._cloneNodeWithoutCheckedRadios(this._item);
this._mirror.style.width = Util.getRectWidth(rect) + 'px';
this._mirror.style.height = Util.getRectHeight(rect) + 'px';
classes.rm(this._mirror, 'gu-transit');
Expand Down
Loading

0 comments on commit 40970a1

Please sign in to comment.