diff --git a/dist/amd/dragula.js b/dist/amd/dragula.js index 65ed873..7165773 100644 --- a/dist/amd/dragula.js +++ b/dist/amd/dragula.js @@ -118,6 +118,7 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u Dragula.prototype.destroy = function destroy() { this._events(true); this._release({}); + this.emitter.destroy(); }; Dragula.prototype._preventGrabbed = function _preventGrabbed(e) { @@ -183,6 +184,7 @@ define(['exports', 'aurelia-dependency-injection', './touchy', './options', './u classes.add(this._copy || this._item, 'gu-transit'); this.renderMirrorImage(); + this.drag(e); }; Dragula.prototype._canStart = function _canStart(item) { diff --git a/dist/amd/emitter.js b/dist/amd/emitter.js index 39fa491..840ac6a 100644 --- a/dist/amd/emitter.js +++ b/dist/amd/emitter.js @@ -58,6 +58,10 @@ define(['exports'], function (exports) { } }; + Emitter.prototype.destroy = function destroy() { + this.events = {}; + }; + Emitter.prototype.emit = function emit() { var _this = this; diff --git a/dist/amd/index.js b/dist/amd/index.js index 1e8e447..caeb146 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -12,7 +12,7 @@ define(['exports', './options', './dragula', './move-before'], function (exports exports.moveBefore = _moveBefore.moveBefore; function configure(config, callback) { var defaults = new _options.Options(); - config.container.registerSingleton(_options.GLOBAL_OPTIONS, defaults); + config.container.registerInstance(_options.GLOBAL_OPTIONS, defaults); if (callback !== undefined && typeof callback === 'function') { callback(defaults); diff --git a/dist/aurelia-dragula.js b/dist/aurelia-dragula.js index 982a7b7..6072ea7 100644 --- a/dist/aurelia-dragula.js +++ b/dist/aurelia-dragula.js @@ -243,6 +243,7 @@ export class Dragula { destroy() { this._events(true); this._release({}); + this.emitter.destroy(); } _preventGrabbed(e) { @@ -308,6 +309,7 @@ export class Dragula { classes.add(this._copy || this._item, 'gu-transit'); this.renderMirrorImage(); + this.drag(e); } _canStart(item) { @@ -680,6 +682,10 @@ export class Emitter { } } + destroy() { + this.events = {}; + } + emit() { let args = arguments ? [...arguments] : []; let type = args.shift(); diff --git a/dist/commonjs/dragula.js b/dist/commonjs/dragula.js index d08da01..cc8db9b 100644 --- a/dist/commonjs/dragula.js +++ b/dist/commonjs/dragula.js @@ -94,6 +94,7 @@ var Dragula = exports.Dragula = function () { Dragula.prototype.destroy = function destroy() { this._events(true); this._release({}); + this.emitter.destroy(); }; Dragula.prototype._preventGrabbed = function _preventGrabbed(e) { @@ -159,6 +160,7 @@ var Dragula = exports.Dragula = function () { classes.add(this._copy || this._item, 'gu-transit'); this.renderMirrorImage(); + this.drag(e); }; Dragula.prototype._canStart = function _canStart(item) { diff --git a/dist/commonjs/emitter.js b/dist/commonjs/emitter.js index 017ff1a..7961bbc 100644 --- a/dist/commonjs/emitter.js +++ b/dist/commonjs/emitter.js @@ -53,6 +53,10 @@ var Emitter = exports.Emitter = function () { } }; + Emitter.prototype.destroy = function destroy() { + this.events = {}; + }; + Emitter.prototype.emit = function emit() { var _this = this; diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 7bcc138..ed208fb 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -18,7 +18,7 @@ exports.DIRECTION = _options.DIRECTION; exports.moveBefore = _moveBefore.moveBefore; function configure(config, callback) { var defaults = new _options.Options(); - config.container.registerSingleton(_options.GLOBAL_OPTIONS, defaults); + config.container.registerInstance(_options.GLOBAL_OPTIONS, defaults); if (callback !== undefined && typeof callback === 'function') { callback(defaults); diff --git a/dist/es2015/dragula.js b/dist/es2015/dragula.js index 4465e9d..0e41931 100644 --- a/dist/es2015/dragula.js +++ b/dist/es2015/dragula.js @@ -81,6 +81,7 @@ export let Dragula = class Dragula { destroy() { this._events(true); this._release({}); + this.emitter.destroy(); } _preventGrabbed(e) { @@ -146,6 +147,7 @@ export let Dragula = class Dragula { classes.add(this._copy || this._item, 'gu-transit'); this.renderMirrorImage(); + this.drag(e); } _canStart(item) { diff --git a/dist/es2015/emitter.js b/dist/es2015/emitter.js index 61c9fa5..fdde84a 100644 --- a/dist/es2015/emitter.js +++ b/dist/es2015/emitter.js @@ -40,6 +40,10 @@ export let Emitter = class Emitter { } } + destroy() { + this.events = {}; + } + emit() { let args = arguments ? [...arguments] : []; let type = args.shift(); diff --git a/dist/es2015/index.js b/dist/es2015/index.js index 04579c6..8a3d408 100644 --- a/dist/es2015/index.js +++ b/dist/es2015/index.js @@ -6,7 +6,7 @@ export { Dragula, Options, DIRECTION, moveBefore }; export function configure(config, callback) { let defaults = new Options(); - config.container.registerSingleton(GLOBAL_OPTIONS, defaults); + config.container.registerInstance(GLOBAL_OPTIONS, defaults); if (callback !== undefined && typeof callback === 'function') { callback(defaults); diff --git a/dist/system/dragula.js b/dist/system/dragula.js index 16cbae7..cb5a33d 100644 --- a/dist/system/dragula.js +++ b/dist/system/dragula.js @@ -113,6 +113,7 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti Dragula.prototype.destroy = function destroy() { this._events(true); this._release({}); + this.emitter.destroy(); }; Dragula.prototype._preventGrabbed = function _preventGrabbed(e) { @@ -178,6 +179,7 @@ System.register(['aurelia-dependency-injection', './touchy', './options', './uti classes.add(this._copy || this._item, 'gu-transit'); this.renderMirrorImage(); + this.drag(e); }; Dragula.prototype._canStart = function _canStart(item) { diff --git a/dist/system/emitter.js b/dist/system/emitter.js index 731cecc..53d637a 100644 --- a/dist/system/emitter.js +++ b/dist/system/emitter.js @@ -59,6 +59,10 @@ System.register([], function (_export, _context) { } }; + Emitter.prototype.destroy = function destroy() { + this.events = {}; + }; + Emitter.prototype.emit = function emit() { var _this = this; diff --git a/dist/system/index.js b/dist/system/index.js index 921f87e..dff9570 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -23,7 +23,7 @@ System.register(['./options', './dragula', './move-before'], function (_export, function configure(config, callback) { var defaults = new Options(); - config.container.registerSingleton(GLOBAL_OPTIONS, defaults); + config.container.registerInstance(GLOBAL_OPTIONS, defaults); if (callback !== undefined && typeof callback === 'function') { callback(defaults); diff --git a/dist/temp/aurelia-dragula.js b/dist/temp/aurelia-dragula.js index 8d26541..4741691 100644 --- a/dist/temp/aurelia-dragula.js +++ b/dist/temp/aurelia-dragula.js @@ -238,6 +238,7 @@ var Dragula = exports.Dragula = function () { Dragula.prototype.destroy = function destroy() { this._events(true); this._release({}); + this.emitter.destroy(); }; Dragula.prototype._preventGrabbed = function _preventGrabbed(e) { @@ -303,6 +304,7 @@ var Dragula = exports.Dragula = function () { classes.add(this._copy || this._item, 'gu-transit'); this.renderMirrorImage(); + this.drag(e); }; Dragula.prototype._canStart = function _canStart(item) { @@ -703,6 +705,10 @@ var Emitter = exports.Emitter = function () { } }; + Emitter.prototype.destroy = function destroy() { + this.events = {}; + }; + Emitter.prototype.emit = function emit() { var _this4 = this; diff --git a/package.json b/package.json index f8ab8ca..1c0ecda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-dragula", - "version": "1.0.1", + "version": "1.0.2", "description": "An aurelia compatible version of Dragula", "keywords": [ "aurelia",