Skip to content

Commit

Permalink
Added generated JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Nalepa committed Jun 28, 2017
1 parent 652e036 commit b01cb7c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
26 changes: 23 additions & 3 deletions dragster.es6.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*@preserve
* Dragster - drag'n'drop library v1.5.0
* Dragster - drag'n'drop library v1.6.0
* https://github.com/sunpietro/dragster
*
* Copyright 2015-2017 Piotr Nalepa
Expand All @@ -10,7 +10,7 @@
*
* Date: 2017-05-06T22:30Z
*/

//jshint ignore:line
var Dragster = function (params) {
var PREFIX_CLASS_DRAGSTER = 'dragster-',
CLASS_DRAGGING = 'is-dragging',
Expand Down Expand Up @@ -961,9 +961,29 @@ var Dragster = function (params) {
regions = findRegionElements();

addEventListenersToRegions();
},
destroy: function () {
regions.forEach(function (region) {
region.classList.remove(CLASS_REGION);

region.removeEventListener(EVT_MOUSEDOWN, regionEventHandlers.mousedown, FALSE);
region.removeEventListener(EVT_MOUSEMOVE, regionEventHandlers.mousemove, FALSE);
region.removeEventListener(EVT_MOUSEUP, regionEventHandlers.mouseup, FALSE);

region.removeEventListener(EVT_TOUCHSTART, regionEventHandlers.mousedown, FALSE);
region.removeEventListener(EVT_TOUCHMOVE, regionEventHandlers.mousemove, FALSE);
region.removeEventListener(EVT_TOUCHEND, regionEventHandlers.mouseup, FALSE);
});

document.body.removeEventListener(EVT_MOUSEMOVE, regionEventHandlers.mousemove, FALSE);
document.body.removeEventListener(EVT_TOUCHMOVE, regionEventHandlers.mousemove, FALSE);
document.body.removeEventListener(EVT_MOUSEUP, regionEventHandlers.mouseup, FALSE);
document.body.removeEventListener(EVT_TOUCHEND, regionEventHandlers.mouseup, FALSE);

window.removeEventListener('resize', discoverWindowHeight, false);
}
};
};

//jshint ignore:line

export default Dragster;
24 changes: 22 additions & 2 deletions dragster.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*@preserve
* Dragster - drag'n'drop library v1.5.0
* Dragster - drag'n'drop library v1.6.0
* https://github.com/sunpietro/dragster
*
* Copyright 2015-2017 Piotr Nalepa
Expand All @@ -10,7 +10,7 @@
*
* Date: 2017-05-06T22:30Z
*/

//jshint ignore:line
;(function (root, moduleName, factory) {
'use strict';

Expand Down Expand Up @@ -974,6 +974,26 @@ var Dragster = function (params) {
regions = findRegionElements();

addEventListenersToRegions();
},
destroy: function () {
regions.forEach(function (region) {
region.classList.remove(CLASS_REGION);

region.removeEventListener(EVT_MOUSEDOWN, regionEventHandlers.mousedown, FALSE);
region.removeEventListener(EVT_MOUSEMOVE, regionEventHandlers.mousemove, FALSE);
region.removeEventListener(EVT_MOUSEUP, regionEventHandlers.mouseup, FALSE);

region.removeEventListener(EVT_TOUCHSTART, regionEventHandlers.mousedown, FALSE);
region.removeEventListener(EVT_TOUCHMOVE, regionEventHandlers.mousemove, FALSE);
region.removeEventListener(EVT_TOUCHEND, regionEventHandlers.mouseup, FALSE);
});

document.body.removeEventListener(EVT_MOUSEMOVE, regionEventHandlers.mousemove, FALSE);
document.body.removeEventListener(EVT_TOUCHMOVE, regionEventHandlers.mousemove, FALSE);
document.body.removeEventListener(EVT_MOUSEUP, regionEventHandlers.mouseup, FALSE);
document.body.removeEventListener(EVT_TOUCHEND, regionEventHandlers.mouseup, FALSE);

window.removeEventListener('resize', discoverWindowHeight, false);
}
};
};
Expand Down
Loading

0 comments on commit b01cb7c

Please sign in to comment.