Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmalonenz committed Apr 1, 2016
1 parent a1764cb commit 662a88e
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 37 deletions.
18 changes: 12 additions & 6 deletions dist/amd/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u
this._emitter.on('out', this.spillOut.bind(this));
}

this.boundStart = this._startBecauseMouseMoved.bind(this);
this.boundGrab = this._grab.bind(this);
this.boundRelease = this._release.bind(this);
this.boundPreventGrabbed = this._preventGrabbed.bind(this);
this.boundDrag = this.drag.bind(this);

this._events();

this._mirror;
Expand Down Expand Up @@ -101,18 +107,18 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u

Dragula.prototype._events = function _events(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
(0, _touchy.touchy)(document.body, op, 'mousedown', this._grab.bind(this));
(0, _touchy.touchy)(document.body, op, 'mouseup', this._release.bind(this));
(0, _touchy.touchy)(document.body, op, 'mousedown', this.boundGrab);
(0, _touchy.touchy)(document.body, op, 'mouseup', this.boundRelease);
};

Dragula.prototype._eventualMovements = function _eventualMovements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
(0, _touchy.touchy)(document.body, op, 'mousemove', this._startBecauseMouseMoved.bind(this));
(0, _touchy.touchy)(document.body, op, 'mousemove', this.boundStart);
};

Dragula.prototype._movements = function _movements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
(0, _touchy.touchy)(document.body, op, 'click', this._preventGrabbed.bind(this));
(0, _touchy.touchy)(document.body, op, 'click', this.boundPreventGrabbed);
};

Dragula.prototype.destroy = function destroy() {
Expand Down Expand Up @@ -471,15 +477,15 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u
classes.rm(this._mirror, 'gu-transit');
classes.add(this._mirror, 'gu-mirror');
this.options.mirrorContainer.appendChild(this._mirror);
(0, _touchy.touchy)(document.documentElement, 'addEventListener', 'mousemove', this.drag.bind(this));
(0, _touchy.touchy)(document.documentElement, 'addEventListener', 'mousemove', this.boundDrag);
classes.add(this.options.mirrorContainer, 'gu-unselectable');
this._emitter.emit('cloned', this._mirror, this._item, 'mirror');
};

Dragula.prototype.removeMirrorImage = function removeMirrorImage() {
if (this._mirror) {
classes.rm(this.options.mirrorContainer, 'gu-unselectable');
(0, _touchy.touchy)(document.documentElement, 'removeEventListener', 'mousemove', this.drag.bind(this));
(0, _touchy.touchy)(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag);
_util.Util.getParent(this._mirror).removeChild(this._mirror);
this._mirror = null;
}
Expand Down
18 changes: 12 additions & 6 deletions dist/aurelia-dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ export class Dragula {
this._emitter.on('out', this.spillOut.bind(this));
}

this.boundStart = this._startBecauseMouseMoved.bind(this);
this.boundGrab = this._grab.bind(this);
this.boundRelease = this._release.bind(this);
this.boundPreventGrabbed = this._preventGrabbed.bind(this);
this.boundDrag = this.drag.bind(this);

this._events();

this._mirror; // mirror image
Expand Down Expand Up @@ -226,18 +232,18 @@ export class Dragula {

_events(remove) {
let op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousedown', this._grab.bind(this));
touchy(document.body, op, 'mouseup', this._release.bind(this));
touchy(document.body, op, 'mousedown', this.boundGrab);
touchy(document.body, op, 'mouseup', this.boundRelease);
}

_eventualMovements(remove) {
let op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousemove', this._startBecauseMouseMoved.bind(this));
touchy(document.body, op, 'mousemove', this.boundStart);
}

_movements(remove) {
let op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'click', this._preventGrabbed.bind(this));
touchy(document.body, op, 'click', this.boundPreventGrabbed);
}

destroy() {
Expand Down Expand Up @@ -584,15 +590,15 @@ export class Dragula {
classes.rm(this._mirror, 'gu-transit');
classes.add(this._mirror, 'gu-mirror');
this.options.mirrorContainer.appendChild(this._mirror);
touchy(document.documentElement, 'addEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'addEventListener', 'mousemove', this.boundDrag);
classes.add(this.options.mirrorContainer, 'gu-unselectable');
this._emitter.emit('cloned', this._mirror, this._item, 'mirror');
}

removeMirrorImage() {
if (this._mirror) {
classes.rm(this.options.mirrorContainer, 'gu-unselectable');
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag);
Util.getParent(this._mirror).removeChild(this._mirror);
this._mirror = null;
}
Expand Down
18 changes: 12 additions & 6 deletions dist/commonjs/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ var Dragula = exports.Dragula = function () {
this._emitter.on('out', this.spillOut.bind(this));
}

this.boundStart = this._startBecauseMouseMoved.bind(this);
this.boundGrab = this._grab.bind(this);
this.boundRelease = this._release.bind(this);
this.boundPreventGrabbed = this._preventGrabbed.bind(this);
this.boundDrag = this.drag.bind(this);

this._events();

this._mirror;
Expand Down Expand Up @@ -77,18 +83,18 @@ var Dragula = exports.Dragula = function () {

Dragula.prototype._events = function _events(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
(0, _touchy.touchy)(document.body, op, 'mousedown', this._grab.bind(this));
(0, _touchy.touchy)(document.body, op, 'mouseup', this._release.bind(this));
(0, _touchy.touchy)(document.body, op, 'mousedown', this.boundGrab);
(0, _touchy.touchy)(document.body, op, 'mouseup', this.boundRelease);
};

Dragula.prototype._eventualMovements = function _eventualMovements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
(0, _touchy.touchy)(document.body, op, 'mousemove', this._startBecauseMouseMoved.bind(this));
(0, _touchy.touchy)(document.body, op, 'mousemove', this.boundStart);
};

Dragula.prototype._movements = function _movements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
(0, _touchy.touchy)(document.body, op, 'click', this._preventGrabbed.bind(this));
(0, _touchy.touchy)(document.body, op, 'click', this.boundPreventGrabbed);
};

Dragula.prototype.destroy = function destroy() {
Expand Down Expand Up @@ -447,15 +453,15 @@ var Dragula = exports.Dragula = function () {
classes.rm(this._mirror, 'gu-transit');
classes.add(this._mirror, 'gu-mirror');
this.options.mirrorContainer.appendChild(this._mirror);
(0, _touchy.touchy)(document.documentElement, 'addEventListener', 'mousemove', this.drag.bind(this));
(0, _touchy.touchy)(document.documentElement, 'addEventListener', 'mousemove', this.boundDrag);
classes.add(this.options.mirrorContainer, 'gu-unselectable');
this._emitter.emit('cloned', this._mirror, this._item, 'mirror');
};

Dragula.prototype.removeMirrorImage = function removeMirrorImage() {
if (this._mirror) {
classes.rm(this.options.mirrorContainer, 'gu-unselectable');
(0, _touchy.touchy)(document.documentElement, 'removeEventListener', 'mousemove', this.drag.bind(this));
(0, _touchy.touchy)(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag);
_util.Util.getParent(this._mirror).removeChild(this._mirror);
this._mirror = null;
}
Expand Down
18 changes: 12 additions & 6 deletions dist/es2015/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export let Dragula = class Dragula {
this._emitter.on('out', this.spillOut.bind(this));
}

this.boundStart = this._startBecauseMouseMoved.bind(this);
this.boundGrab = this._grab.bind(this);
this.boundRelease = this._release.bind(this);
this.boundPreventGrabbed = this._preventGrabbed.bind(this);
this.boundDrag = this.drag.bind(this);

this._events();

this._mirror;
Expand Down Expand Up @@ -64,18 +70,18 @@ export let Dragula = class Dragula {

_events(remove) {
let op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousedown', this._grab.bind(this));
touchy(document.body, op, 'mouseup', this._release.bind(this));
touchy(document.body, op, 'mousedown', this.boundGrab);
touchy(document.body, op, 'mouseup', this.boundRelease);
}

_eventualMovements(remove) {
let op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousemove', this._startBecauseMouseMoved.bind(this));
touchy(document.body, op, 'mousemove', this.boundStart);
}

_movements(remove) {
let op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'click', this._preventGrabbed.bind(this));
touchy(document.body, op, 'click', this.boundPreventGrabbed);
}

destroy() {
Expand Down Expand Up @@ -430,15 +436,15 @@ export let Dragula = class Dragula {
classes.rm(this._mirror, 'gu-transit');
classes.add(this._mirror, 'gu-mirror');
this.options.mirrorContainer.appendChild(this._mirror);
touchy(document.documentElement, 'addEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'addEventListener', 'mousemove', this.boundDrag);
classes.add(this.options.mirrorContainer, 'gu-unselectable');
this._emitter.emit('cloned', this._mirror, this._item, 'mirror');
}

removeMirrorImage() {
if (this._mirror) {
classes.rm(this.options.mirrorContainer, 'gu-unselectable');
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag);
Util.getParent(this._mirror).removeChild(this._mirror);
this._mirror = null;
}
Expand Down
18 changes: 12 additions & 6 deletions dist/system/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti
this._emitter.on('out', this.spillOut.bind(this));
}

this.boundStart = this._startBecauseMouseMoved.bind(this);
this.boundGrab = this._grab.bind(this);
this.boundRelease = this._release.bind(this);
this.boundPreventGrabbed = this._preventGrabbed.bind(this);
this.boundDrag = this.drag.bind(this);

this._events();

this._mirror;
Expand Down Expand Up @@ -96,18 +102,18 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti

Dragula.prototype._events = function _events(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousedown', this._grab.bind(this));
touchy(document.body, op, 'mouseup', this._release.bind(this));
touchy(document.body, op, 'mousedown', this.boundGrab);
touchy(document.body, op, 'mouseup', this.boundRelease);
};

Dragula.prototype._eventualMovements = function _eventualMovements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousemove', this._startBecauseMouseMoved.bind(this));
touchy(document.body, op, 'mousemove', this.boundStart);
};

Dragula.prototype._movements = function _movements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'click', this._preventGrabbed.bind(this));
touchy(document.body, op, 'click', this.boundPreventGrabbed);
};

Dragula.prototype.destroy = function destroy() {
Expand Down Expand Up @@ -466,15 +472,15 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti
classes.rm(this._mirror, 'gu-transit');
classes.add(this._mirror, 'gu-mirror');
this.options.mirrorContainer.appendChild(this._mirror);
touchy(document.documentElement, 'addEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'addEventListener', 'mousemove', this.boundDrag);
classes.add(this.options.mirrorContainer, 'gu-unselectable');
this._emitter.emit('cloned', this._mirror, this._item, 'mirror');
};

Dragula.prototype.removeMirrorImage = function removeMirrorImage() {
if (this._mirror) {
classes.rm(this.options.mirrorContainer, 'gu-unselectable');
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag);
Util.getParent(this._mirror).removeChild(this._mirror);
this._mirror = null;
}
Expand Down
18 changes: 12 additions & 6 deletions dist/temp/aurelia-dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ var Dragula = exports.Dragula = function () {
this._emitter.on('out', this.spillOut.bind(this));
}

this.boundStart = this._startBecauseMouseMoved.bind(this);
this.boundGrab = this._grab.bind(this);
this.boundRelease = this._release.bind(this);
this.boundPreventGrabbed = this._preventGrabbed.bind(this);
this.boundDrag = this.drag.bind(this);

this._events();

this._mirror;
Expand Down Expand Up @@ -221,18 +227,18 @@ var Dragula = exports.Dragula = function () {

Dragula.prototype._events = function _events(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousedown', this._grab.bind(this));
touchy(document.body, op, 'mouseup', this._release.bind(this));
touchy(document.body, op, 'mousedown', this.boundGrab);
touchy(document.body, op, 'mouseup', this.boundRelease);
};

Dragula.prototype._eventualMovements = function _eventualMovements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'mousemove', this._startBecauseMouseMoved.bind(this));
touchy(document.body, op, 'mousemove', this.boundStart);
};

Dragula.prototype._movements = function _movements(remove) {
var op = remove ? 'removeEventListener' : 'addEventListener';
touchy(document.body, op, 'click', this._preventGrabbed.bind(this));
touchy(document.body, op, 'click', this.boundPreventGrabbed);
};

Dragula.prototype.destroy = function destroy() {
Expand Down Expand Up @@ -591,15 +597,15 @@ var Dragula = exports.Dragula = function () {
classes.rm(this._mirror, 'gu-transit');
classes.add(this._mirror, 'gu-mirror');
this.options.mirrorContainer.appendChild(this._mirror);
touchy(document.documentElement, 'addEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'addEventListener', 'mousemove', this.boundDrag);
classes.add(this.options.mirrorContainer, 'gu-unselectable');
this._emitter.emit('cloned', this._mirror, this._item, 'mirror');
};

Dragula.prototype.removeMirrorImage = function removeMirrorImage() {
if (this._mirror) {
classes.rm(this.options.mirrorContainer, 'gu-unselectable');
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.drag.bind(this));
touchy(document.documentElement, 'removeEventListener', 'mousemove', this.boundDrag);
Util.getParent(this._mirror).removeChild(this._mirror);
this._mirror = null;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-dragula",
"version": "1.0.3",
"version": "1.0.4",
"description": "An aurelia compatible version of Dragula",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 662a88e

Please sign in to comment.