Permalink
Browse files

Merge pull request #297 from koenbok/gestures2

Rewrite gesture support
  • Loading branch information...
koenbok committed Jan 26, 2016
2 parents 790d6ce + 5be9b69 commit 5c031e08a6b3f905ee5be88d45bcb18769a7b3ed
View
@@ -62,3 +62,5 @@ _cache
_steps
_builds
_projects
extras/DevServer.framer/app.coffee
extras/DevServer.framer/framer/config.json
@@ -31,4 +31,6 @@ framer/backups/*
framer/.*.hash
framer/framer.generated.js
framer/framer.modules.js
framer/images/*
framer/images/*
app.coffee
app.js

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
View
@@ -266,8 +266,12 @@ class exports.Context extends BaseClass
return window.innerHeight
@define "frame", get: -> {x:0, y:0, width:@width, height:@height}
@define "size", get: -> _.pluck(@frame, ["x", "y"])
@define "point", get: -> _.pluck(@frame, ["width", "height"])
@define "size", get: -> _.pick(@frame, ["width", "height"])
@define "point", get: -> _.pick(@frame, ["x", "y"])
@define "canvasFrame",
get: ->
return @frame if not parent
return @parent.canvasFrame
@define "backgroundColor",
get: ->
@@ -1,6 +1,5 @@
{_} = require "./Underscore"
{EventEmitter} = require "./EventEmitter"
{GestureManagerElement} = require "./GestureManager"
Utils = require "./Utils"
View

This file was deleted.

Oops, something went wrong.
View
@@ -1,7 +1,8 @@
{_} = require "./Underscore"
Utils = require "./Utils"
{_} = require "./Underscore"
{Gestures} = require "./Gestures"
Events = {}
# Standard touch events
@@ -42,6 +43,9 @@ Events.Scroll = "scroll"
Events.ImageLoaded = "load"
Events.ImageLoadError = "error"
# Add all gesture events
_.extend(Events, Gestures)
# Extract touch events for any event
Events.touchEvent = (event) ->
touchEvent = event.touches?[0]
@@ -52,4 +56,7 @@ Events.touchEvent = (event) ->
Events.wrap = (element) ->
Framer.CurrentContext.domEventManager.wrap(element)
Events.isGesture = (eventName) ->
return eventName in Gestures
exports.Events = Events
@@ -39,9 +39,6 @@ class TouchEmulator extends BaseClass
constructor: ->
if not @isHammerTouchSupported()
throw new Error "Touch emulation for hammer is not supported"
@touchPointerImage = "framer/images/cursor@2x.png"
@touchPointerImageActive = "framer/images/cursor-active@2x.png"
@touchPointerImageSize = 64
@@ -92,9 +89,6 @@ class TouchEmulator extends BaseClass
opacity: 0
scale: 1.2
time: 0.08
isHammerTouchSupported: ->
window.ontouchstart is null
keydown: (event) =>
View
@@ -42,13 +42,12 @@ Framer.BezierCurveAnimator = (require "./Animators/BezierCurveAnimator").BezierC
Framer.SpringDHOAnimator = (require "./Animators/SpringDHOAnimator").SpringDHOAnimator
Framer.SpringRK4Animator = (require "./Animators/SpringRK4Animator").SpringRK4Animator
Framer.LayerDraggable = (require "./LayerDraggable").LayerDraggable
Framer.Importer = (require "./Importer").Importer
Framer.Debug = (require "./Debug").Debug
Framer.Extras = require "./Extras/Extras"
# Add version info
Framer.GestureInputRecognizer = new (require "./GestureInputRecognizer").GestureInputRecognizer
Framer.Version = require "../build/Version"
Framer.Loop = new Framer.AnimationLoop()
Utils.domComplete(Framer.Loop.start)
@@ -62,6 +61,5 @@ Framer.resetDefaults = Defaults.reset
Framer.DefaultContext = new Framer.Context(name:"Default")
Framer.CurrentContext = Framer.DefaultContext
# Fix for mobile scrolling
Framer.Extras.MobileScrollFix.enable() if Utils.isMobile()
Framer.Extras.TouchEmulator.enable()
Framer.Extras.TouchEmulator.enable() if not Utils.isTouch()
Oops, something went wrong.

0 comments on commit 5c031e0

Please sign in to comment.