Permalink
Browse files

Don't show hints when clicking on a layer belonging to another context

  • Loading branch information...
koenbok committed Aug 3, 2016
1 parent b2763d2 commit b69ac080d2b930f782d573712cf99a31c9b4796a
Showing with 23 additions and 21 deletions.
  1. +5 −21 extras/Studio.framer/app.coffee
  2. +7 −0 framer/Context.coffee
  3. +11 −0 framer/Extras/Hints.coffee
@@ -2,28 +2,12 @@ Framer.Info =
title: "Bolt Inbox"
author: "Floris Verloop"
twitter: "fverloop"
- openInFramerURL: true
- date: "Today"
- description: """
- If anyone knows a good E-mail client for mac? I don't know. So I desgined my own, simply and useful Bolt Inbox⚡️!
-
- Please let me know in comments, whether you'll use this UI with pleasure, or maybe you prefer different style.
-Show love Dude, press L 🚀
-If anyone knows a good E-mail client for mac? I don't know. So I desgined my own, simply and useful Bolt Inbox⚡️!
-
- Please let me know in comments, whether you'll use this UI with pleasure, or maybe you prefer different style.
-Show love Dude, press L 🚀
+Framer.Extras.ShareInfo.enable()
+Framer.Extras.Hints.enable()
-If anyone knows a good E-mail client for mac? I don't know. So I desgined my own, simply and useful Bolt Inbox⚡️!
-
- Please let me know in comments, whether you'll use this UI with pleasure, or maybe you prefer different style.
-Show love Dude, press L 🚀
-If anyone knows a good E-mail client for mac? I don't know. So I desgined my own, simply and useful Bolt Inbox⚡️!
-
- Please let me know in comments, whether you'll use this UI with pleasure, or maybe you prefer different style.
-Show love Dude, press L 🚀
- """
+layer = new Layer
+ point: Align.center
-Framer.Extras.ShareInfo.enable()
+layer.onClick ->
View
@@ -31,8 +31,12 @@ these at any time.
###
+Contexts = []
+
class exports.Context extends BaseClass
+ @all = -> return _.clone(Contexts)
+
@define "parent",
get: -> @_parent
@@ -62,6 +66,8 @@ class exports.Context extends BaseClass
else
@index = @id
+ Contexts.push(@)
+
reset: ->
@_createDOMEventManager()
@@ -77,6 +83,7 @@ class exports.Context extends BaseClass
destroy: ->
@reset()
@_destroyRootElement()
+ _.remove(Contexts, @)
##############################################################
# Collections
View
@@ -1,3 +1,5 @@
+{Context} = require "../Context"
+
class Hints
constructor: ->
@@ -23,6 +25,15 @@ class Hints
# See what layer we actually tapped
layer = Framer.CurrentContext.layerForElement(@_target)
+ # If this is not a layer in this context, we see if it belongs
+ # to another. If so we don't really have to throw a hint, because
+ # you are very likely clicking on print or share info.
+ if not layer
+ for context in Context.all()
+ continue if context is Framer.DefaultContext
+ continue if context is Framer.CurrentContext
+ return if context.layerForElement(@_target)
+
# If this is a layer with interaction, we do not show any hints
if layer and layer.willSeemToDoSomething()
return

0 comments on commit b69ac08

Please sign in to comment.