oribella-longtap
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -0,1 +1,11 @@ | ||
<a name="0.3.2"></a> | ||
## [0.3.2](https://github.com/oribella/longtap/compare/v0.3.1...v0.3.2) (2015-12-11) | ||
### Bug Fixes | ||
* **dist:** update dist ([0290c44](https://github.com/oribella/longtap/commit/0290c44)) | ||
<a name="0.3.1"></a> | ||
@@ -2,0 +12,0 @@ ## [0.3.1](https://github.com/oribella/longtap/compare/v0.3.0...v0.3.1) (2015-12-10) |
@@ -9,43 +9,14 @@ "use strict"; | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
class Longtap { | ||
static defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
} | ||
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 Longtap = exports.Longtap = (function () { | ||
_createClass(Longtap, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
}]); | ||
function Longtap(subscriber, element) { | ||
_classCallCheck(this, Longtap); | ||
constructor(subscriber, element) { | ||
this.subscriber = subscriber; | ||
@@ -58,3 +29,3 @@ this.element = element; | ||
this.data = {}; | ||
//timeEnd only used in longtap | ||
if (typeof this.subscriber.timeEnd === "undefined") { | ||
@@ -65,45 +36,40 @@ this.subscriber.timeEnd = function () {}; | ||
_createClass(Longtap, [{ | ||
key: "start", | ||
value: function start(event, pagePoints) { | ||
var _this = this; | ||
start(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.startPoint = pagePoints[0]; | ||
this.timeoutId = setTimeout(() => { | ||
this.valid = true; | ||
this.subscriber.timeEnd(event, this.data, this.element); | ||
}, this.subscriber.options.timeThreshold); | ||
this.result = this.subscriber.start(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED; | ||
} | ||
this.data.pagePoints = pagePoints; | ||
this.startPoint = pagePoints[0]; | ||
this.timeoutId = setTimeout(function () { | ||
_this.valid = true; | ||
_this.subscriber.timeEnd(event, _this.data, _this.element); | ||
}, this.subscriber.options.timeThreshold); | ||
this.result = this.subscriber.start(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED; | ||
update(event, pagePoints) { | ||
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
}, { | ||
key: "update", | ||
value: function update(event, pagePoints) { | ||
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
} | ||
end(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
if (!this.valid) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
}, { | ||
key: "end", | ||
value: function end(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
if (!this.valid) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
}, { | ||
key: "cancel", | ||
value: function cancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
}]); | ||
return Longtap; | ||
})(); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
cancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
} | ||
exports.Longtap = Longtap; | ||
}); |
"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", { | ||
@@ -12,21 +10,13 @@ value: true | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Longtap = exports.Longtap = (function () { | ||
_createClass(Longtap, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
}]); | ||
function Longtap(subscriber, element) { | ||
_classCallCheck(this, Longtap); | ||
class Longtap { | ||
static defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
constructor(subscriber, element) { | ||
this.subscriber = subscriber; | ||
@@ -44,45 +34,32 @@ this.element = element; | ||
} | ||
_createClass(Longtap, [{ | ||
key: "start", | ||
value: function start(event, pagePoints) { | ||
var _this = this; | ||
this.data.pagePoints = pagePoints; | ||
this.startPoint = pagePoints[0]; | ||
this.timeoutId = setTimeout(function () { | ||
_this.valid = true; | ||
_this.subscriber.timeEnd(event, _this.data, _this.element); | ||
}, this.subscriber.options.timeThreshold); | ||
this.result = this.subscriber.start(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED; | ||
start(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.startPoint = pagePoints[0]; | ||
this.timeoutId = setTimeout(() => { | ||
this.valid = true; | ||
this.subscriber.timeEnd(event, this.data, this.element); | ||
}, this.subscriber.options.timeThreshold); | ||
this.result = this.subscriber.start(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result) + _oribellaFramework.RETURN_FLAG.STARTED; | ||
} | ||
update(event, pagePoints) { | ||
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
}, { | ||
key: "update", | ||
value: function update(event, pagePoints) { | ||
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
} | ||
end(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
if (!this.valid) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
}, { | ||
key: "end", | ||
value: function end(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
if (!this.valid) { | ||
return _oribellaFramework.RETURN_FLAG.REMOVE; | ||
} | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
}, { | ||
key: "cancel", | ||
value: function cancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
}]); | ||
return Longtap; | ||
})(); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
cancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
} | ||
exports.Longtap = Longtap; |
"use strict"; | ||
System.register(["oribella-framework"], function (_export) { | ||
var RETURN_FLAG, _createClass, Longtap; | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
var RETURN_FLAG; | ||
return { | ||
@@ -17,37 +10,14 @@ setters: [function (_oribellaFramework) { | ||
execute: function () { | ||
_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); | ||
} | ||
class Longtap { | ||
static defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
return function (Constructor, protoProps, staticProps) { | ||
if (protoProps) defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
}; | ||
})(); | ||
_export("Longtap", Longtap = (function () { | ||
_createClass(Longtap, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
radiusThreshold: 2, | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 500 | ||
}; | ||
} | ||
}]); | ||
function Longtap(subscriber, element) { | ||
_classCallCheck(this, Longtap); | ||
constructor(subscriber, element) { | ||
this.subscriber = subscriber; | ||
@@ -66,49 +36,39 @@ this.element = element; | ||
_createClass(Longtap, [{ | ||
key: "start", | ||
value: function start(event, pagePoints) { | ||
var _this = this; | ||
start(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
this.startPoint = pagePoints[0]; | ||
this.timeoutId = setTimeout(() => { | ||
this.valid = true; | ||
this.subscriber.timeEnd(event, this.data, this.element); | ||
}, this.subscriber.options.timeThreshold); | ||
this.result = this.subscriber.start(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result) + RETURN_FLAG.STARTED; | ||
} | ||
this.data.pagePoints = pagePoints; | ||
this.startPoint = pagePoints[0]; | ||
this.timeoutId = setTimeout(function () { | ||
_this.valid = true; | ||
_this.subscriber.timeEnd(event, _this.data, _this.element); | ||
}, this.subscriber.options.timeThreshold); | ||
this.result = this.subscriber.start(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result) + RETURN_FLAG.STARTED; | ||
update(event, pagePoints) { | ||
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) { | ||
return RETURN_FLAG.REMOVE; | ||
} | ||
}, { | ||
key: "update", | ||
value: function update(event, pagePoints) { | ||
if (pagePoints[0].distanceTo(this.startPoint) > this.subscriber.options.radiusThreshold) { | ||
return RETURN_FLAG.REMOVE; | ||
} | ||
} | ||
}, { | ||
key: "end", | ||
value: function end(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
} | ||
if (!this.valid) { | ||
return RETURN_FLAG.REMOVE; | ||
} | ||
end(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result); | ||
if (!this.valid) { | ||
return RETURN_FLAG.REMOVE; | ||
} | ||
}, { | ||
key: "cancel", | ||
value: function cancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
}]); | ||
return Longtap; | ||
})()); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result); | ||
} | ||
cancel(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
clearTimeout(this.timeoutId); | ||
this.subscriber.cancel(event, this.data, this.element); | ||
} | ||
} | ||
_export("Longtap", Longtap); | ||
@@ -115,0 +75,0 @@ } |
{ | ||
"name": "oribella-longtap", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Longtap gesture", | ||
@@ -37,4 +37,4 @@ "license": "MIT", | ||
"jspm": "^0.16.15", | ||
"oribella-dev": "^0.1.4" | ||
"oribella-dev": "^0.1.6" | ||
} | ||
} |
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
11051
13
236