From a892b069e866f7d87bd0d8439deec38e2cd604fd Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 28 Jun 2012 11:05:07 -0700 Subject: Fixing body background bug --- js/panels/properties.reel/sections/custom.reel/custom.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'js/panels/properties.reel/sections/custom.reel/custom.js') diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index 9c31cf45..5112fca9 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js @@ -115,11 +115,25 @@ exports.CustomSection = Montage.create(Component, { value: function(event) { // Change the stage color for now //console.log(this, event); - if (event._event.color && event._event.color.css) { + + if (event._event.colorMode !== 'gradient' && event._event.color) { + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-color', [event._event.color.css], "Change", "pi", ''); + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-image', ['none'], "Change", "pi", ''); + } else if (event._event.color) { + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-image', [event._event.color.css], "Change", "pi", ''); + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-color', ['none'], "Change", "pi", ''); + } else { + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-image', ['none'], "Change", "pi", ''); + ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-color', ['none'], "Change", "pi", ''); + } + + /* +if (event._event.color && event._event.color.css) { ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); } else { ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, ['none'], "Change", "pi", ''); } +*/ /* var propEvent = document.createEvent("CustomEvent"); propEvent.initEvent("propertyChange", true, true); -- cgit v1.2.3