Skip to content

Commit

Permalink
Build for Release
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmalonenz committed Mar 15, 2016
1 parent 220b336 commit 4b40fd7
Show file tree
Hide file tree
Showing 11 changed files with 323 additions and 1 deletion.
63 changes: 63 additions & 0 deletions dist/amd/dragula-and-drop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
define(['exports', 'babel-runtime/helpers/create-class', 'babel-runtime/helpers/class-call-check', 'babel-runtime/core-js/object/assign', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', './options', './dragula'], function (exports, _babelRuntimeHelpersCreateClass, _babelRuntimeHelpersClassCallCheck, _babelRuntimeCoreJsObjectAssign, _aureliaTemplating, _aureliaBinding, _aureliaDependencyInjection, _options, _dragula) {
'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});

var DragulaAndDrop = (function () {
function DragulaAndDrop(globalOptions) {
(0, _babelRuntimeHelpersClassCallCheck['default'])(this, _DragulaAndDrop);

this.globalOptions = globalOptions;
this.drake;
}

(0, _babelRuntimeHelpersCreateClass['default'])(DragulaAndDrop, [{
key: 'bind',
value: function bind() {
var boundOptions = {
moves: this.moves,
accepts: this.accepts,
invalid: this.invalid,
containers: this.containers,
isContainer: this.isContainer,
copy: this.copy,
copySortSource: this.copySortSource,
revertOnSpill: this.revertOnSpill,
removeOnSpill: this.removeOnSpill,
direction: this.direction,
ignoreInputTextSelection: this.ignoreInputTextSelection,
mirrorContainer: this.mirrorContainer
};

var options = (0, _babelRuntimeCoreJsObjectAssign['default'])({}, this.globalOptions, boundOptions);
this.drake = new _dragula.Dragula(options);
}
}, {
key: 'unbind',
value: function unbind() {
this.drake.destroy();
}
}]);
var _DragulaAndDrop = DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.noView)()(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaDependencyInjection.inject)(_options.GLOBAL_OPTIONS)(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.customElement)('dragula-and-drop')(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'direction', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copySortSource', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copy', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'containers', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'invalid', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'accepts', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'moves', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
return DragulaAndDrop;
})();

exports.DragulaAndDrop = DragulaAndDrop;
});
9 changes: 9 additions & 0 deletions dist/amd/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ define(['exports', 'babel-runtime/helpers/create-class', 'babel-runtime/helpers/
value: true
});

var MIN_TIME_BETWEEN_REDRAWS_MS = 20;

var Dragula = (function () {
function Dragula(options) {
(0, _babelRuntimeHelpersClassCallCheck['default'])(this, _Dragula);
Expand Down Expand Up @@ -198,6 +200,8 @@ define(['exports', 'babel-runtime/helpers/create-class', 'babel-runtime/helpers/
this._initialSibling = context.item.nextSibling;
this._currentSibling = _util.Util.nextEl(context.item);

this._timeSinceLastMove = Date.now() + MIN_TIME_BETWEEN_REDRAWS_MS;

this.dragging = true;
this.emitter.emit('drag', this._item, this._source);
}
Expand Down Expand Up @@ -355,6 +359,11 @@ define(['exports', 'babel-runtime/helpers/create-class', 'babel-runtime/helpers/
if (!this._mirror) {
return;
}

if (Date.now() - this._timeSinceLastMove <= MIN_TIME_BETWEEN_REDRAWS_MS) {
return;
}
this._timeSinceLastMove = Date.now();
e.preventDefault();

var moved = function moved(type) {
Expand Down
2 changes: 2 additions & 0 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ define(['exports', './options', './dragula'], function (exports, _options, _drag
if (callback !== undefined && typeof callback === 'function') {
callback(defaults);
}

config.globalResources(['./dragula-and-drop']);
}
});
78 changes: 78 additions & 0 deletions dist/commonjs/dragula-and-drop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
'use strict';

var _createClass = require('babel-runtime/helpers/create-class')['default'];

var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];

var _Object$assign = require('babel-runtime/core-js/object/assign')['default'];

Object.defineProperty(exports, '__esModule', {
value: true
});

var _aureliaTemplating = require('aurelia-templating');

var _aureliaBinding = require('aurelia-binding');

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _options = require('./options');

var _dragula = require('./dragula');

var DragulaAndDrop = (function () {
function DragulaAndDrop(globalOptions) {
_classCallCheck(this, _DragulaAndDrop);

this.globalOptions = globalOptions;
this.drake;
}

_createClass(DragulaAndDrop, [{
key: 'bind',
value: function bind() {
var boundOptions = {
moves: this.moves,
accepts: this.accepts,
invalid: this.invalid,
containers: this.containers,
isContainer: this.isContainer,
copy: this.copy,
copySortSource: this.copySortSource,
revertOnSpill: this.revertOnSpill,
removeOnSpill: this.removeOnSpill,
direction: this.direction,
ignoreInputTextSelection: this.ignoreInputTextSelection,
mirrorContainer: this.mirrorContainer
};

var options = _Object$assign({}, this.globalOptions, boundOptions);
this.drake = new _dragula.Dragula(options);
}
}, {
key: 'unbind',
value: function unbind() {
this.drake.destroy();
}
}]);

var _DragulaAndDrop = DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.noView)()(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaDependencyInjection.inject)(_options.GLOBAL_OPTIONS)(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.customElement)('dragula-and-drop')(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'direction', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copySortSource', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'copy', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'containers', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'invalid', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'accepts', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
DragulaAndDrop = (0, _aureliaTemplating.bindable)({ name: 'moves', defaultBindingMode: _aureliaBinding.bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop;
return DragulaAndDrop;
})();

exports.DragulaAndDrop = DragulaAndDrop;
9 changes: 9 additions & 0 deletions dist/commonjs/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var _classes = require('./classes');

var classes = _interopRequireWildcard(_classes);

var MIN_TIME_BETWEEN_REDRAWS_MS = 20;

var Dragula = (function () {
function Dragula(options) {
_classCallCheck(this, _Dragula);
Expand Down Expand Up @@ -217,6 +219,8 @@ var Dragula = (function () {
this._initialSibling = context.item.nextSibling;
this._currentSibling = _util.Util.nextEl(context.item);

this._timeSinceLastMove = Date.now() + MIN_TIME_BETWEEN_REDRAWS_MS;

this.dragging = true;
this.emitter.emit('drag', this._item, this._source);
}
Expand Down Expand Up @@ -374,6 +378,11 @@ var Dragula = (function () {
if (!this._mirror) {
return;
}

if (Date.now() - this._timeSinceLastMove <= MIN_TIME_BETWEEN_REDRAWS_MS) {
return;
}
this._timeSinceLastMove = Date.now();
e.preventDefault();

var moved = function moved(type) {
Expand Down
2 changes: 2 additions & 0 deletions dist/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ function configure(config, callback) {
if (callback !== undefined && typeof callback === 'function') {
callback(defaults);
}

config.globalResources(['./dragula-and-drop']);
}
53 changes: 53 additions & 0 deletions dist/es6/dragula-and-drop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import {customElement, bindable, noView} from 'aurelia-templating';
import {bindingMode} from 'aurelia-binding';
import {inject} from 'aurelia-dependency-injection';

import {Options, DIRECTION, GLOBAL_OPTIONS} from './options';
import {Dragula} from './dragula';

@bindable({ name: 'moves', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'accepts', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'invalid', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'containers', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'copy', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'copySortSource', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'direction', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: bindingMode.oneTime })
@customElement('dragula-and-drop')
@inject(GLOBAL_OPTIONS)
@noView()
export class DragulaAndDrop {

constructor(globalOptions) {
this.globalOptions = globalOptions;
this.drake;
}

bind() {
let boundOptions = {
moves: this.moves,
accepts: this.accepts,
invalid: this.invalid,
containers: this.containers,
isContainer: this.isContainer,
copy: this.copy,
copySortSource: this.copySortSource,
revertOnSpill: this.revertOnSpill,
removeOnSpill: this.removeOnSpill,
direction: this.direction,
ignoreInputTextSelection: this.ignoreInputTextSelection,
mirrorContainer: this.mirrorContainer
};

let options = Object.assign({}, this.globalOptions, boundOptions);
this.drake = new Dragula(options);
}

unbind() {
this.drake.destroy();
}
}
8 changes: 8 additions & 0 deletions dist/es6/dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Util} from './util';
import {Emitter} from './emitter';
import * as classes from './classes';

const MIN_TIME_BETWEEN_REDRAWS_MS = 20;

@inject(GLOBAL_OPTIONS)
export class Dragula {
Expand Down Expand Up @@ -194,6 +195,8 @@ export class Dragula {
this._initialSibling = context.item.nextSibling;
this._currentSibling = Util.nextEl(context.item);

this._timeSinceLastMove = Date.now() + MIN_TIME_BETWEEN_REDRAWS_MS; //ensure that the first frame draws...

this.dragging = true;
this.emitter.emit('drag', this._item, this._source);
}
Expand Down Expand Up @@ -337,6 +340,11 @@ export class Dragula {
if (!this._mirror) {
return;
}

if (Date.now() - this._timeSinceLastMove <= MIN_TIME_BETWEEN_REDRAWS_MS) {
return;
}
this._timeSinceLastMove = Date.now();
e.preventDefault();

let moved = (type) => { this.emitter.emit(type, item, this._lastDropTarget, this._source); }
Expand Down
2 changes: 2 additions & 0 deletions dist/es6/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export function configure(config, callback) {
if (callback !== undefined && typeof(callback) === 'function') {
callback(defaults);
}

config.globalResources(['./dragula-and-drop']);
}
Loading

0 comments on commit 4b40fd7

Please sign in to comment.