Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Includes a local version of pepjs.js 0.3.0 because of
jquery-archive/PEP#223. Will remove and reference the
npm package when that's fixed.

Haven't tested with Framer Studio yet, only framer-cli.
  • Loading branch information
Weston Thayer committed Oct 7, 2015
1 parent 4839ac7 commit 9b818bd
Show file tree
Hide file tree
Showing 4 changed files with 1,391 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .gitattributes

This file was deleted.

36 changes: 36 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This touches the window object, breaking module encapsulation.
// Just make sure it's only require'd once.
require("./pepjs");

var PepEvents = {
PointerMove: "pointermove",
PointerDown: "pointerdown",
PointerUp: "pointerup",
PointerOver: "pointerover",
PointerOut: "pointerout",
PointerEnter: "pointerenter",
PointerLeave: "pointerleave",
PointerCancel: "pointercancel"
};

exports.PointerEvents = PepEvents;

class PepLayer extends Framer.Layer {
constructor(options={}) {
super(options);

this._element.setAttribute("touch-action", "none");

// needed to pass Framer's Utils.domValidEvent check
this._element.onpointermove = null;
this._element.onpointerdown = null;
this._element.onpointerup = null;
this._element.onpointerover = null;
this._element.onpointerout = null;
this._element.onpointerenter = null;
this._element.onpointerleave = null;
this._element.onpointercancel = null;
}
}

exports.PointerEventLayer = PepLayer;
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "framer-pep",
"version": "0.1.0",
"description": "Framer adapter for jquery's PEP (PointerEvents Polyfill)",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Weston Thayer <me@westonthayer.com>",
"repository": {
"type": "git",
"url": "https://github.com/WestonThayer/framer-pep"
},
"bugs": {
"url": "https://github.com/WestonThayer/framer-pep/issues"
},
"keywords": [
"framerjs",
"framer",
"pep",
"pepjs",
"pointerevents"
],
"license": "MIT"
}
Loading

0 comments on commit 9b818bd

Please sign in to comment.