diff --git a/dist/amd/dragula-and-drop.js b/dist/amd/dragula-and-drop.js new file mode 100644 index 0000000..ce4e109 --- /dev/null +++ b/dist/amd/dragula-and-drop.js @@ -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; +}); \ No newline at end of file diff --git a/dist/amd/dragula.js b/dist/amd/dragula.js index b233cca..594941f 100644 --- a/dist/amd/dragula.js +++ b/dist/amd/dragula.js @@ -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); @@ -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); } @@ -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) { diff --git a/dist/amd/index.js b/dist/amd/index.js index ee73d40..a707353 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -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']); } }); \ No newline at end of file diff --git a/dist/commonjs/dragula-and-drop.js b/dist/commonjs/dragula-and-drop.js new file mode 100644 index 0000000..1f18376 --- /dev/null +++ b/dist/commonjs/dragula-and-drop.js @@ -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; \ No newline at end of file diff --git a/dist/commonjs/dragula.js b/dist/commonjs/dragula.js index bd0ce3a..9bb828b 100644 --- a/dist/commonjs/dragula.js +++ b/dist/commonjs/dragula.js @@ -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); @@ -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); } @@ -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) { diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index ed58524..ee49b21 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -19,4 +19,6 @@ function configure(config, callback) { if (callback !== undefined && typeof callback === 'function') { callback(defaults); } + + config.globalResources(['./dragula-and-drop']); } \ No newline at end of file diff --git a/dist/es6/dragula-and-drop.js b/dist/es6/dragula-and-drop.js new file mode 100644 index 0000000..8d98d92 --- /dev/null +++ b/dist/es6/dragula-and-drop.js @@ -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(); + } +} \ No newline at end of file diff --git a/dist/es6/dragula.js b/dist/es6/dragula.js index 26fb802..a03c836 100644 --- a/dist/es6/dragula.js +++ b/dist/es6/dragula.js @@ -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 { @@ -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); } @@ -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); } diff --git a/dist/es6/index.js b/dist/es6/index.js index 2e0dd21..1c39d97 100644 --- a/dist/es6/index.js +++ b/dist/es6/index.js @@ -10,4 +10,6 @@ export function configure(config, callback) { if (callback !== undefined && typeof(callback) === 'function') { callback(defaults); } + + config.globalResources(['./dragula-and-drop']); } diff --git a/dist/system/dragula-and-drop.js b/dist/system/dragula-and-drop.js new file mode 100644 index 0000000..39d429c --- /dev/null +++ b/dist/system/dragula-and-drop.js @@ -0,0 +1,87 @@ +System.register(['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 (_export) { + var _createClass, _classCallCheck, _Object$assign, customElement, bindable, noView, bindingMode, inject, Options, DIRECTION, GLOBAL_OPTIONS, Dragula, DragulaAndDrop; + + return { + setters: [function (_babelRuntimeHelpersCreateClass) { + _createClass = _babelRuntimeHelpersCreateClass['default']; + }, function (_babelRuntimeHelpersClassCallCheck) { + _classCallCheck = _babelRuntimeHelpersClassCallCheck['default']; + }, function (_babelRuntimeCoreJsObjectAssign) { + _Object$assign = _babelRuntimeCoreJsObjectAssign['default']; + }, function (_aureliaTemplating) { + customElement = _aureliaTemplating.customElement; + bindable = _aureliaTemplating.bindable; + noView = _aureliaTemplating.noView; + }, function (_aureliaBinding) { + bindingMode = _aureliaBinding.bindingMode; + }, function (_aureliaDependencyInjection) { + inject = _aureliaDependencyInjection.inject; + }, function (_options) { + Options = _options.Options; + DIRECTION = _options.DIRECTION; + GLOBAL_OPTIONS = _options.GLOBAL_OPTIONS; + }, function (_dragula) { + Dragula = _dragula.Dragula; + }], + execute: function () { + 'use strict'; + + 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(options); + } + }, { + key: 'unbind', + value: function unbind() { + this.drake.destroy(); + } + }]); + + var _DragulaAndDrop = DragulaAndDrop; + DragulaAndDrop = noView()(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = inject(GLOBAL_OPTIONS)(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = customElement('dragula-and-drop')(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'mirrorContainer', attribute: 'mirror-container', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'ignoreInputTextSelection', attribute: 'ingore-input-text-selection', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'direction', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'removeOnSpill', attribute: 'remove-on-spill', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'revertOnSpill', attribute: 'revert-on-spill', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'copySortSource', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'copy', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'isContainer', attribute: 'is-container', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'containers', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'invalid', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'accepts', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + DragulaAndDrop = bindable({ name: 'moves', defaultBindingMode: bindingMode.oneTime })(DragulaAndDrop) || DragulaAndDrop; + return DragulaAndDrop; + })(); + + _export('DragulaAndDrop', DragulaAndDrop); + } + }; +}); \ No newline at end of file diff --git a/dist/system/dragula.js b/dist/system/dragula.js index 257e8a3..3e46ce2 100644 --- a/dist/system/dragula.js +++ b/dist/system/dragula.js @@ -1,5 +1,5 @@ System.register(['babel-runtime/helpers/create-class', 'babel-runtime/helpers/class-call-check', 'aurelia-dependency-injection', './touchy', './options', './util', './emitter', './classes'], function (_export) { - var _createClass, _classCallCheck, inject, touchy, GLOBAL_OPTIONS, Options, Util, Emitter, classes, Dragula; + var _createClass, _classCallCheck, inject, touchy, GLOBAL_OPTIONS, Options, Util, Emitter, classes, MIN_TIME_BETWEEN_REDRAWS_MS, Dragula; return { setters: [function (_babelRuntimeHelpersCreateClass) { @@ -23,6 +23,8 @@ System.register(['babel-runtime/helpers/create-class', 'babel-runtime/helpers/cl execute: function () { 'use strict'; + MIN_TIME_BETWEEN_REDRAWS_MS = 20; + Dragula = (function () { function Dragula(options) { _classCallCheck(this, _Dragula); @@ -216,6 +218,8 @@ System.register(['babel-runtime/helpers/create-class', 'babel-runtime/helpers/cl this._initialSibling = context.item.nextSibling; this._currentSibling = Util.nextEl(context.item); + this._timeSinceLastMove = Date.now() + MIN_TIME_BETWEEN_REDRAWS_MS; + this.dragging = true; this.emitter.emit('drag', this._item, this._source); } @@ -373,6 +377,11 @@ System.register(['babel-runtime/helpers/create-class', 'babel-runtime/helpers/cl 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) {