Skip to content

Commit

Permalink
Stop event propagation from the share component.
Browse files Browse the repository at this point in the history
  • Loading branch information
eelco committed Jul 28, 2016
1 parent 0d9f714 commit 04a5d8c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions framer/Components/ShareComponent.coffee
Expand Up @@ -95,9 +95,9 @@ class ShareComponent
truncate = (str, n) -> truncate = (str, n) ->
str.substr(0, n-1).trim() + "…" str.substr(0, n-1).trim() + "…"


if @shareInfo.twitter and @shareInfo.title.length > 26 if @shareInfo.twitter and @shareInfo.title?.length > 26
@shareInfo.title = truncate(@shareInfo.title, 26) @shareInfo.title = truncate(@shareInfo.title, 26)
else if @shareInfo.title.length > 34 else if @shareInfo.title?.length > 34
@shareInfo.title = truncate(@shareInfo.title, 34) @shareInfo.title = truncate(@shareInfo.title, 34)


# Render main sheet # Render main sheet
Expand Down Expand Up @@ -489,6 +489,11 @@ class ShareComponent
@style = @style =
cursor: "default" cursor: "default"


# Disable events propagating up to block unintented interactions
@sheet.onTouchStart (event) -> event.stopPropagation()
@sheet.onTouchEnd (event) -> event.stopPropagation()
@sheet.onTouchMove (event) -> event.stopPropagation()

# Toggle sheet when clicked on close or open buttons # Toggle sheet when clicked on close or open buttons
@close.onClick => @close.onClick =>
@options.fixed = true @options.fixed = true
Expand Down

0 comments on commit 04a5d8c

Please sign in to comment.