Permalink
Browse files

Not hiding the DefaultContext for the preloader

For some reason setting the visiblity of the defaultcontext influences rendering ellipsis when setting `truncation: true` and `height: 300`
  • Loading branch information...
nvh committed Mar 24, 2017
1 parent 4428af1 commit 413c18d5cf40eccf578b0b035ead23eb460eb6b8
Showing with 6 additions and 10 deletions.
  1. +6 −3 framer/Extras/Preloader.coffee
  2. +0 −7 framer/Framer.coffee
@@ -79,7 +79,9 @@ class Preloader extends BaseClass
# Another bit of delay to find out if the images are already cached
# so we avoid a mini flickr of the progress indicator.
Utils.delay 0.2, => @cover.visible = true
Utils.delay 0.2, =>
@progressIndicator.visible = true
@brand.visible = true
# By default we take the image from the prototype and the device
@addImagesFromContext(Framer.DefaultContext)
@@ -108,7 +110,7 @@ class Preloader extends BaseClass
@_isLoading = false
@context?.destroy()
if @cover?.visible and animated
if @progressIndicator?.visible and animated
@cover?.animate
properties: {opacity: 0}
time: 0.13
@@ -137,12 +139,12 @@ class Preloader extends BaseClass
@cover = new Layer
frame: Canvas
backgroundColor: "white"
visible: false
@progressIndicator = new CircularProgressComponent
size: 160
point: Align.center
parent: @cover
visible: false
@progressIndicator.railsColor = Color.grey(0, 0.1)
@progressIndicator.progressColor = "rgb(75, 169, 248)"
@@ -152,6 +154,7 @@ class Preloader extends BaseClass
size: 96
parent: @cover
backgroundColor: null
visible: false
style:
backgroundSize: "50%"
View
@@ -73,7 +73,6 @@ Framer.resetDefaults = Defaults.reset
# the preloader can pick it up if it needs to.
Framer.DefaultContext = new Framer.Context(name: "Default")
Framer.DefaultContext.backgroundColor = "white"
Framer.DefaultContext.visible = false
Framer.CurrentContext = Framer.DefaultContext
window.Canvas = new (require "./Canvas").Canvas
@@ -84,10 +83,4 @@ Framer.Extras.ErrorDisplay.enable() if not Utils.isFramerStudio()
Framer.Extras.Preloader.enable() if not Utils.isFramerStudio()
Framer.Extras.Hints.enable() if not Utils.isFramerStudio()
# If there is no preloader around, we show the default context
# This _won't_ avoid a flickr of the device if you use the preloader
# from your code directly, unfortunately. But at this point, that is an
# action in the future, so we can't know wether that will happen or not.
Framer.DefaultContext.visible = true unless Framer.Preloader
Utils.domComplete(Framer.Loop.start)

0 comments on commit 413c18d

Please sign in to comment.