oribella-doubletap
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/doubletap/compare/v0.3.2...v0.3.3) (2015-12-11) | ||
### Bug Fixes | ||
* **dist:** use `es2015`, `stage-1` and `stage-2` ([6b6bbc5](https://github.com/oribella/doubletap/commit/6b6bbc5)) | ||
<a name="0.3.2"></a> | ||
@@ -2,0 +12,0 @@ ## [0.3.2](https://github.com/oribella/doubletap/compare/v0.3.1...v0.3.2) (2015-12-11) |
@@ -9,13 +9,42 @@ "use strict"; | ||
class Doubletap { | ||
static defaultOptions() { | ||
return { | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 250 | ||
}; | ||
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 Doubletap = exports.Doubletap = (function () { | ||
_createClass(Doubletap, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 250 | ||
}; | ||
} | ||
}]); | ||
function Doubletap(subscriber, element) { | ||
_classCallCheck(this, Doubletap); | ||
this.subscriber = subscriber; | ||
@@ -29,39 +58,43 @@ this.element = element; | ||
bind(on, element, remove) { | ||
this.removeTap = on(element, "tap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
end: this.tapend.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
unbind() { | ||
if (this.count > 1) { | ||
this.removeTap(); | ||
return true; | ||
_createClass(Doubletap, [{ | ||
key: "bind", | ||
value: function bind(on, element, remove) { | ||
this.removeTap = on(element, "tap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
end: this.tapend.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
return false; | ||
} | ||
tapend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
++this.count; | ||
if (this.count === 1) { | ||
this.timeoutId = setTimeout(() => { | ||
this.remove(); | ||
}, { | ||
key: "unbind", | ||
value: function unbind() { | ||
if (this.count > 1) { | ||
this.removeTap(); | ||
}, this.subscriber.options.timeThreshold); | ||
} else if (this.count === 2) { | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
}, { | ||
key: "tapend", | ||
value: function tapend(event, pagePoints) { | ||
var _this = this; | ||
} | ||
this.data.pagePoints = pagePoints; | ||
++this.count; | ||
if (this.count === 1) { | ||
this.timeoutId = setTimeout(function () { | ||
_this.remove(); | ||
_this.removeTap(); | ||
}, this.subscriber.options.timeThreshold); | ||
} else if (this.count === 2) { | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
} | ||
}]); | ||
exports.Doubletap = Doubletap; | ||
return Doubletap; | ||
})(); | ||
}); |
"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,12 +12,20 @@ value: true | ||
class Doubletap { | ||
static defaultOptions() { | ||
return { | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 250 | ||
}; | ||
} | ||
constructor(subscriber, element) { | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Doubletap = exports.Doubletap = (function () { | ||
_createClass(Doubletap, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 250 | ||
}; | ||
} | ||
}]); | ||
function Doubletap(subscriber, element) { | ||
_classCallCheck(this, Doubletap); | ||
this.subscriber = subscriber; | ||
@@ -28,32 +38,43 @@ this.element = element; | ||
} | ||
bind(on, element, remove) { | ||
this.removeTap = on(element, "tap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
end: this.tapend.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
unbind() { | ||
if (this.count > 1) { | ||
this.removeTap(); | ||
return true; | ||
_createClass(Doubletap, [{ | ||
key: "bind", | ||
value: function bind(on, element, remove) { | ||
this.removeTap = on(element, "tap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
end: this.tapend.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
return false; | ||
} | ||
tapend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
++this.count; | ||
if (this.count === 1) { | ||
this.timeoutId = setTimeout(() => { | ||
this.remove(); | ||
}, { | ||
key: "unbind", | ||
value: function unbind() { | ||
if (this.count > 1) { | ||
this.removeTap(); | ||
}, this.subscriber.options.timeThreshold); | ||
} else if (this.count === 2) { | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
} | ||
exports.Doubletap = Doubletap; | ||
}, { | ||
key: "tapend", | ||
value: function tapend(event, pagePoints) { | ||
var _this = this; | ||
this.data.pagePoints = pagePoints; | ||
++this.count; | ||
if (this.count === 1) { | ||
this.timeoutId = setTimeout(function () { | ||
_this.remove(); | ||
_this.removeTap(); | ||
}, this.subscriber.options.timeThreshold); | ||
} else if (this.count === 2) { | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return _oribellaFramework.RETURN_FLAG.map(this.result); | ||
} | ||
} | ||
}]); | ||
return Doubletap; | ||
})(); |
"use strict"; | ||
System.register(["oribella-framework"], function (_export) { | ||
var RETURN_FLAG; | ||
var RETURN_FLAG, _createClass, Doubletap; | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
return { | ||
@@ -10,13 +17,36 @@ setters: [function (_oribellaFramework) { | ||
execute: function () { | ||
class Doubletap { | ||
static defaultOptions() { | ||
return { | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 250 | ||
}; | ||
_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("Doubletap", Doubletap = (function () { | ||
_createClass(Doubletap, null, [{ | ||
key: "defaultOptions", | ||
value: function defaultOptions() { | ||
return { | ||
touches: 1, | ||
prio: 90, | ||
which: 1, | ||
timeThreshold: 250 | ||
}; | ||
} | ||
}]); | ||
function Doubletap(subscriber, element) { | ||
_classCallCheck(this, Doubletap); | ||
this.subscriber = subscriber; | ||
@@ -30,37 +60,46 @@ this.element = element; | ||
bind(on, element, remove) { | ||
this.removeTap = on(element, "tap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
end: this.tapend.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
_createClass(Doubletap, [{ | ||
key: "bind", | ||
value: function bind(on, element, remove) { | ||
this.removeTap = on(element, "tap", { | ||
selector: this.subscriber.selector, | ||
options: this.subscriber.options, | ||
end: this.tapend.bind(this) | ||
}); | ||
this.remove = remove; | ||
} | ||
}, { | ||
key: "unbind", | ||
value: function unbind() { | ||
if (this.count > 1) { | ||
this.removeTap(); | ||
return true; | ||
} | ||
unbind() { | ||
if (this.count > 1) { | ||
this.removeTap(); | ||
return true; | ||
return false; | ||
} | ||
}, { | ||
key: "tapend", | ||
value: function tapend(event, pagePoints) { | ||
var _this = this; | ||
return false; | ||
} | ||
this.data.pagePoints = pagePoints; | ||
++this.count; | ||
tapend(event, pagePoints) { | ||
this.data.pagePoints = pagePoints; | ||
++this.count; | ||
if (this.count === 1) { | ||
this.timeoutId = setTimeout(function () { | ||
_this.remove(); | ||
if (this.count === 1) { | ||
this.timeoutId = setTimeout(() => { | ||
this.remove(); | ||
this.removeTap(); | ||
}, this.subscriber.options.timeThreshold); | ||
} else if (this.count === 2) { | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result); | ||
_this.removeTap(); | ||
}, this.subscriber.options.timeThreshold); | ||
} else if (this.count === 2) { | ||
clearTimeout(this.timeoutId); | ||
this.result = this.subscriber.end(event, this.data, this.element); | ||
return RETURN_FLAG.map(this.result); | ||
} | ||
} | ||
} | ||
}]); | ||
} | ||
return Doubletap; | ||
})()); | ||
@@ -67,0 +106,0 @@ _export("Doubletap", Doubletap); |
{ | ||
"name": "oribella-doubletap", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Doubletap gesture", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"oribella-framework": "npm:oribella-framework@^0.3.1" | ||
"oribella-framework": "npm:oribella-framework@^0.3.4" | ||
}, | ||
@@ -38,4 +38,4 @@ "devDependencies": { | ||
"jspm": "^0.16.15", | ||
"oribella-dev": "^0.1.6" | ||
"oribella-dev": "^0.1.7" | ||
} | ||
} |
14862
14
352