Skip to content

Commit

Permalink
chore(): changing prerelease name, updating docs, ensure proper minif…
Browse files Browse the repository at this point in the history
…ication
  • Loading branch information
reppners committed Jan 23, 2018
1 parent bce4c10 commit ad3b746
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -25,10 +25,10 @@ commands are available as npm scripts to abstract away the current task runner o

## Debugging

For debugging purposes run with `npm start` and set `const DEBUG = true;` in the main source file.
For debugging purposes run with `npm start` and set `const DEBUG = true;` in the `constants.ts` file.
This will result in verbose console output that helps to track down issues.

To get visual feedback on the state of the drag-and-drop operation additionaly include `drag-drop-polyfill-debug.css`.
To get visual feedback on the state of the drag-and-drop operation additionally include `drag-drop-polyfill-debug.css`.


## Releasing
Expand Down
18 changes: 10 additions & 8 deletions Gruntfile.js
Expand Up @@ -35,15 +35,15 @@ module.exports = function (grunt) {
updateConfigs: ["pkg"],
commit: true,
commitMessage: "Release v%VERSION%",
commitFiles: ["package.json", "bower.json", "CHANGELOG.md", "release"],
commitFiles: ["package.json", "package-lock.json", "bower.json", "CHANGELOG.md", "release"],
createTag: true,
tagName: "v%VERSION%",
tagMessage: "Version %VERSION%",
push: true,
pushTo: "origin",
gitDescribeOptions: "--tags --always --abbrev=1 --dirty=-d",
globalReplace: false,
prereleaseName: "alpha",
prereleaseName: "rc",
metadata: "",
regExp: false
}
Expand Down Expand Up @@ -120,10 +120,10 @@ module.exports = function (grunt) {
mangle: {
reserved: [
umdName
]
},
mangleProperties: {
regex: /^_/ // this will mangle all properties starting with an underscore
],
properties: {
regex: /^_/ // this will mangle all properties starting with an underscore
}
},
reserveDOMProperties: true, // do not mangle browser props
compress: {
Expand All @@ -136,10 +136,12 @@ module.exports = function (grunt) {
join_vars: true,
keep_fargs: true,
conditionals: true,
evaluate: true
evaluate: true,
passes: 1,
warnings: true
},
sourceMap: true,
report: "min"
report: "gzip"
},
main: {
options: {
Expand Down
46 changes: 30 additions & 16 deletions README.md
Expand Up @@ -27,10 +27,6 @@ Check out the demo to see it in action and monitor the console to see the events

## Install

**bower**

`bower install mobile-drag-drop --save`

**npm**

`npm install mobile-drag-drop --save`
Expand All @@ -39,6 +35,9 @@ Check out the demo to see it in action and monitor the console to see the events

`jspm install npm:mobile-drag-drop`

**bower**

`bower install mobile-drag-drop --save`

### Include

Expand Down Expand Up @@ -119,30 +118,45 @@ export type DragImageTranslateOverrideFn = (
) => void;

export interface Config {

// flag to force the polyfill being applied and not rely on internal feature detection
forceApply?: boolean;
forceApply?:boolean;

// useful for when you want the default drag image but still want to apply
// some static offset from touch coordinates to drag image coordinates
// defaults to (0,0)
dragImageOffset?: Point;
dragImageOffset?:Point;

// if the dragImage shall be centered on the touch coordinates
// defaults to false
dragImageCenterOnTouch?: boolean;
dragImageCenterOnTouch?:boolean;

// the drag and drop operation involves some processing. here you can specify in what interval this processing takes place.
// defaults to 150ms
iterationInterval?: number;
iterationInterval?:number;

// hook for custom logic that decides if a drag operation should start
// executed once with the initial touchmove and if true is returned the drag-operation initializes.
// defaults to (event.touches.length === 1)
dragStartConditionOverride?: (event: TouchEvent) => boolean;
dragStartConditionOverride?:( event:TouchEvent ) => boolean;

// hook for custom logic that can manipulate the drag image translate offset
dragImageTranslateOverride?: DragImageTranslateOverrideFn;
dragImageTranslateOverride?:DragImageTranslateOverrideFn;

// hook for custom logic that can override the default action based on the original touch event when the drag never started
// be sure to call event.preventDefault() if handling the default action in the override to prevent the browser default.
defaultActionOverride?: (event: TouchEvent) => void;
// Drag action delay on touch devices ("hold to drag" functionality, useful for scrolling draggable items).
// Defaults to no delay.
holdToDrag?: number;
defaultActionOverride?:( event:TouchEvent ) => void;

// Drag action delay on touch devices ("hold to drag" functionality, useful for scrolling draggable items). Defaults to no delay.
holdToDrag?:number;

// function invoked for each touchstart event to determine if and which touched element is detected as "draggable"
tryFindDraggableTarget?:( event:TouchEvent ) => HTMLElement | undefined;

// function for creating a copy of the dragged element
dragImageSetup?:( element:HTMLElement ) => HTMLElement;

// function for determining element that is currently hovered while dragging
// defaults to `document.elementFromPoint()`
elementFromPoint?:( x:number, y:number ) => Element;
}

// invoke for initializing the polyfill => returns true if polyfill is applied
Expand Down

0 comments on commit ad3b746

Please sign in to comment.