Permalink
Browse files

Improved keeping track of previous background color

  • Loading branch information...
nvh committed Apr 24, 2017
1 parent 63333cf commit bce05cc69bc8ec38b510ec71e12dd7747d04504c
Showing with 4 additions and 0 deletions.
  1. +4 −0 framer/Components/DeviceComponent.coffee
@@ -75,6 +75,7 @@ class exports.DeviceComponent extends BaseClass
@background.clip = true
@background.backgroundColor = "transparent"
@background.classList.add("DeviceBackground")
+ @_previousBackgroundColor = @background.backgroundColor
@hands = new Layer
@handsImageLayer = new Layer parent: @hands
@@ -370,7 +371,10 @@ class exports.DeviceComponent extends BaseClass
@_previousBackgroundColor = @background.backgroundColor
@background.backgroundColor = @screen.backgroundColor
@screen.on "change:backgroundColor", (color) =>
+ # Hacky way to keep the prev backgroundColor
+ prev = @_previousBackgroundColor
@background.backgroundColor = color
+ @_previousBackgroundColor = prev
@background.on "change:backgroundColor", (color) =>
@_previousBackgroundColor = color
@background.backgroundColor = @screen.backgroundColor

0 comments on commit bce05cc

Please sign in to comment.