oribella-longtap-swipe
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -0,1 +1,11 @@ | ||
<a name="0.3.3"></a> | ||
## [0.3.3](https://github.com/oribella/longtap-swipe/compare/v0.3.2...v0.3.3) (2015-12-11) | ||
### Bug Fixes | ||
* **dist:** use `es2015`, `stage-1` and `stage-2` ([cbd9207](https://github.com/oribella/longtap-swipe/commit/cbd9207)) | ||
<a name="0.3.2"></a> | ||
@@ -2,0 +12,0 @@ ## [0.3.2](https://github.com/oribella/longtap-swipe/compare/v0.3.1...v0.3.2) (2015-12-11) |
@@ -9,14 +9,43 @@ "use strict"; | ||
class LongtapSwipe { | ||
static defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 100, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
constructor(subscriber, element) { | ||
var _createClass = (function () { | ||
function defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
}; | ||
})(); | ||
var LongtapSwipe = exports.LongtapSwipe = (function () { | ||
_createClass(LongtapSwipe, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 100, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
}]); | ||
function LongtapSwipe(subscriber, element) { | ||
_classCallCheck(this, LongtapSwipe); | ||
this.subscriber = subscriber; | ||
@@ -31,69 +60,73 @@ this.element = element; | ||
bind(addHandle, element, remove) { | ||
var lts = this; | ||
this.removeLongtap = addHandle(element, "longtap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
start() { | ||
lts.allowSwipe = false; | ||
}, | ||
timeEnd() { | ||
lts.allowSwipe = true; | ||
_createClass(LongtapSwipe, [{ | ||
key: "bind", | ||
value: function bind(addHandle, element, remove) { | ||
var lts = this; | ||
this.removeLongtap = addHandle(element, "longtap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
start: function start() { | ||
lts.allowSwipe = false; | ||
}, | ||
timeEnd: function timeEnd() { | ||
lts.allowSwipe = true; | ||
} | ||
}); | ||
this.removeSwipe = addHandle(element, "swipe", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
down: this.swipedown.bind(this), | ||
start: this.swipestart.bind(this), | ||
update: this.swipeupdate.bind(this), | ||
end: this.swipeend.bind(this), | ||
cancel: this.swipecancel.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
}, { | ||
key: "unbind", | ||
value: function unbind() { | ||
this.removeLongtap(); | ||
this.removeSwipe(); | ||
} | ||
}, { | ||
key: "swipedown", | ||
value: function swipedown(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.result = this.subscriber.down(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
}, { | ||
key: "swipestart", | ||
value: function swipestart(event, pagePoints) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return false; | ||
} | ||
}); | ||
this.removeSwipe = addHandle(element, "swipe", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
down: this.swipedown.bind(this), | ||
start: this.swipestart.bind(this), | ||
update: this.swipeupdate.bind(this), | ||
end: this.swipeend.bind(this), | ||
cancel: this.swipecancel.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
unbind() { | ||
this.removeLongtap(); | ||
this.removeSwipe(); | ||
} | ||
swipedown(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.result = this.subscriber.down(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
swipestart(event, pagePoints) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return false; | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.start(event, this.data, this.element); | ||
return true; | ||
} | ||
}, { | ||
key: "swipeupdate", | ||
value: function swipeupdate(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.update(event, this.data, this.element); | ||
} | ||
}, { | ||
key: "swipeend", | ||
value: function swipeend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.end(event, this.data, this.element); | ||
} | ||
}, { | ||
key: "swipecancel", | ||
value: function swipecancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
}]); | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.start(event, this.data, this.element); | ||
return true; | ||
} | ||
swipeupdate(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.update(event, this.data, this.element); | ||
} | ||
swipeend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.end(event, this.data, this.element); | ||
} | ||
swipecancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
} | ||
exports.LongtapSwipe = LongtapSwipe; | ||
return LongtapSwipe; | ||
})(); | ||
}); |
"use strict"; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,13 +12,21 @@ value: true | ||
class LongtapSwipe { | ||
static defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 100, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
constructor(subscriber, element) { | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var LongtapSwipe = exports.LongtapSwipe = (function () { | ||
_createClass(LongtapSwipe, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 100, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
}]); | ||
function LongtapSwipe(subscriber, element) { | ||
_classCallCheck(this, LongtapSwipe); | ||
this.subscriber = subscriber; | ||
@@ -30,56 +40,73 @@ this.element = element; | ||
} | ||
bind(addHandle, element, remove) { | ||
var lts = this; | ||
this.removeLongtap = addHandle(element, "longtap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
start() { | ||
lts.allowSwipe = false; | ||
}, | ||
timeEnd() { | ||
lts.allowSwipe = true; | ||
_createClass(LongtapSwipe, [{ | ||
key: "bind", | ||
value: function bind(addHandle, element, remove) { | ||
var lts = this; | ||
this.removeLongtap = addHandle(element, "longtap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
start: function start() { | ||
lts.allowSwipe = false; | ||
}, | ||
timeEnd: function timeEnd() { | ||
lts.allowSwipe = true; | ||
} | ||
}); | ||
this.removeSwipe = addHandle(element, "swipe", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
down: this.swipedown.bind(this), | ||
start: this.swipestart.bind(this), | ||
update: this.swipeupdate.bind(this), | ||
end: this.swipeend.bind(this), | ||
cancel: this.swipecancel.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
}, { | ||
key: "unbind", | ||
value: function unbind() { | ||
this.removeLongtap(); | ||
this.removeSwipe(); | ||
} | ||
}, { | ||
key: "swipedown", | ||
value: function swipedown(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.result = this.subscriber.down(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
}, { | ||
key: "swipestart", | ||
value: function swipestart(event, pagePoints) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return false; | ||
} | ||
}); | ||
this.removeSwipe = addHandle(element, "swipe", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
down: this.swipedown.bind(this), | ||
start: this.swipestart.bind(this), | ||
update: this.swipeupdate.bind(this), | ||
end: this.swipeend.bind(this), | ||
cancel: this.swipecancel.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
unbind() { | ||
this.removeLongtap(); | ||
this.removeSwipe(); | ||
} | ||
swipedown(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.result = this.subscriber.down(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
swipestart(event, pagePoints) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return false; | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.start(event, this.data, this.element); | ||
return true; | ||
} | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.start(event, this.data, this.element); | ||
return true; | ||
} | ||
swipeupdate(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.update(event, this.data, this.element); | ||
} | ||
swipeend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.end(event, this.data, this.element); | ||
} | ||
swipecancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
} | ||
exports.LongtapSwipe = LongtapSwipe; | ||
}, { | ||
key: "swipeupdate", | ||
value: function swipeupdate(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.update(event, this.data, this.element); | ||
} | ||
}, { | ||
key: "swipeend", | ||
value: function swipeend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.end(event, this.data, this.element); | ||
} | ||
}, { | ||
key: "swipecancel", | ||
value: function swipecancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
}]); | ||
return LongtapSwipe; | ||
})(); |
"use strict"; | ||
System.register(["oribella-framework"], function (_export) { | ||
var RETURN_FLAG; | ||
var RETURN_FLAG, _createClass, LongtapSwipe; | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
return { | ||
@@ -10,14 +17,37 @@ setters: [function (_oribellaFramework) { | ||
execute: function () { | ||
class LongtapSwipe { | ||
static defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 100, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
_createClass = (function () { | ||
function defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
constructor(subscriber, element) { | ||
return function (Constructor, protoProps, staticProps) { | ||
if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
}; | ||
})(); | ||
_export("LongtapSwipe", LongtapSwipe = (function () { | ||
_createClass(LongtapSwipe, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 100, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
}]); | ||
function LongtapSwipe(subscriber, element) { | ||
_classCallCheck(this, LongtapSwipe); | ||
this.subscriber = subscriber; | ||
@@ -32,68 +62,75 @@ this.element = element; | ||
bind(addHandle, element, remove) { | ||
var lts = this; | ||
this.removeLongtap = addHandle(element, "longtap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
start() { | ||
lts.allowSwipe = false; | ||
}, | ||
timeEnd() { | ||
lts.allowSwipe = true; | ||
_createClass(LongtapSwipe, [{ | ||
key: "bind", | ||
value: function bind(addHandle, element, remove) { | ||
var lts = this; | ||
this.removeLongtap = addHandle(element, "longtap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
start: function start() { | ||
lts.allowSwipe = false; | ||
}, | ||
timeEnd: function timeEnd() { | ||
lts.allowSwipe = true; | ||
} | ||
}); | ||
this.removeSwipe = addHandle(element, "swipe", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
down: this.swipedown.bind(this), | ||
start: this.swipestart.bind(this), | ||
update: this.swipeupdate.bind(this), | ||
end: this.swipeend.bind(this), | ||
cancel: this.swipecancel.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
}, { | ||
key: "unbind", | ||
value: function unbind() { | ||
this.removeLongtap(); | ||
this.removeSwipe(); | ||
} | ||
}, { | ||
key: "swipedown", | ||
value: function swipedown(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.result = this.subscriber.down(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result); | ||
} | ||
}, { | ||
key: "swipestart", | ||
value: function swipestart(event, pagePoints) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return false; | ||
} | ||
}); | ||
this.removeSwipe = addHandle(element, "swipe", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
down: this.swipedown.bind(this), | ||
start: this.swipestart.bind(this), | ||
update: this.swipeupdate.bind(this), | ||
end: this.swipeend.bind(this), | ||
cancel: this.swipecancel.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
unbind() { | ||
this.removeLongtap(); | ||
this.removeSwipe(); | ||
} | ||
swipedown(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.result = this.subscriber.down(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result); | ||
} | ||
swipestart(event, pagePoints) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return false; | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.start(event, this.data, this.element); | ||
return true; | ||
} | ||
}, { | ||
key: "swipeupdate", | ||
value: function swipeupdate(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.update(event, this.data, this.element); | ||
} | ||
}, { | ||
key: "swipeend", | ||
value: function swipeend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.end(event, this.data, this.element); | ||
} | ||
}, { | ||
key: "swipecancel", | ||
value: function swipecancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
}]); | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.start(event, this.data, this.element); | ||
return true; | ||
} | ||
return LongtapSwipe; | ||
})()); | ||
swipeupdate(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.update(event, this.data, this.element); | ||
} | ||
swipeend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.end(event, this.data, this.element); | ||
} | ||
swipecancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
} | ||
_export("LongtapSwipe", LongtapSwipe); | ||
@@ -100,0 +137,0 @@ } |
{ | ||
"name": "oribella-longtap-swipe", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Longtap swipe gesture", | ||
@@ -37,4 +37,4 @@ "license": "MIT", | ||
"jspm": "^0.16.15", | ||
"oribella-dev": "^0.1.6" | ||
"oribella-dev": "^0.1.7" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19793
14
477