-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from gnehs/dev
Dev
- Loading branch information
Showing
9 changed files
with
105 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*! | ||
* long-press.js | ||
* Pure JavaScript long-press event | ||
* https://github.com/john-doherty/long-press | ||
* @author John Doherty <www.johndoherty.info> | ||
* @license MIT | ||
*/ | ||
! function(t, e) { | ||
"use strict"; | ||
|
||
function n() { this.dispatchEvent(new CustomEvent("long-press", { bubbles: !0, cancelable: !0 })), clearTimeout(o), console && console.log && console.log("long-press fired on " + this.outerHTML) } | ||
var o = null, | ||
u = "ontouchstart" in t || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, | ||
s = u ? "touchstart" : "mousedown", | ||
i = u ? "touchcancel" : "mouseout", | ||
a = u ? "touchend" : "mouseup", | ||
c = u ? "touchmove" : "mousemove"; | ||
"initCustomEvent" in e.createEvent("CustomEvent") && (t.CustomEvent = function(t, n) { n = n || { bubbles: !1, cancelable: !1, detail: void 0 }; var o = e.createEvent("CustomEvent"); return o.initCustomEvent(t, n.bubbles, n.cancelable, n.detail), o }, t.CustomEvent.prototype = t.Event.prototype), e.addEventListener(s, function(t) { | ||
var e = t.target, | ||
u = parseInt(e.getAttribute("data-long-press-delay") || "1500", 10); | ||
o = setTimeout(n.bind(e), u) | ||
}), e.addEventListener(a, function(t) { clearTimeout(o) }), e.addEventListener(i, function(t) { clearTimeout(o) }), e.addEventListener(c, function(t) { clearTimeout(o) }) | ||
}(this, document); | ||
|
||
/* | ||
* //listen for long-press events | ||
* document.addEventListener('long-press', function(e) { | ||
* e.target.setAttribute('data-editing', 'true'); | ||
* }); | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.