Permalink
Browse files

Not preloading Gradients

  • Loading branch information...
nvh committed Oct 2, 2017
1 parent f057af6 commit 2a91ec1d89e56dea202eee388e371d3f797c3335
Showing with 12 additions and 0 deletions.
  1. +1 −0 framer/Extras/Preloader.coffee
  2. +1 −0 test/tests.coffee
  3. +10 −0 test/tests/PreloaderTest.coffee
@@ -43,6 +43,7 @@ class Preloader extends BaseClass
_.map(context.layers, "player").map(@addPlayer)
addImage: (image) =>
return if image instanceof Gradient
if image and image not in @_media
@_media.push(image)
# We simply count failed images as loaded for now so that we avoid
View
@@ -54,5 +54,6 @@ require "./tests/DeviceComponentTest"
require "./tests/SliderComponentTest"
require "./tests/RangeSliderComponentTest"
require "./tests/FlowComponentTest"
require "./tests/PreloaderTest"
mocha.run()
@@ -0,0 +1,10 @@
describe "Preloader", ->
it "should not preload gradients", ->
Framer.CurrentContext = new Framer.Context(name: "test")
Framer.CurrentContext.run ->
new Layer
gradient:
start: "red"
Framer.Extras.Preloader.enable()
Framer.Preloader.addImagesFromContext(Framer.CurrentContext)
Framer.Preloader._media.length.should.equal 0

0 comments on commit 2a91ec1

Please sign in to comment.