From 549e56e2204a48639cb60fe2e83e847910d23125 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 27 Jul 2018 22:05:28 +0100 Subject: [PATCH] Add editorTheme.palette.theme to allow overriding colours --- CHANGELOG.md | 3 ++- editor/js/ui/diff.js | 2 +- editor/js/ui/editor.js | 4 ++-- editor/js/ui/palette-editor.js | 2 +- editor/js/ui/palette.js | 2 +- editor/js/ui/search.js | 2 +- editor/js/ui/tab-info.js | 2 +- editor/js/ui/typeSearch.js | 2 +- editor/js/ui/utils.js | 35 ++++++++++++++++++++++++++++++++++ editor/js/ui/view-navigator.js | 2 +- editor/js/ui/view.js | 4 ++-- 11 files changed, 48 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9acf83e1..ee591143f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Editor - - Add Context data sidebar + - Add editorTheme.palette.theme to allow overriding colours - Index all node properties when searching Fixes #1446 - Handle NaN and Infinity properly in debug sidebar Fixes #1778 #1779 - Prevent horizontal scroll when palette name cannot wrap @@ -44,6 +44,7 @@ Nodes Persistent Context + - Add Context data sidebar - Add persistable context option - Add default memory store - Add file-based context store diff --git a/editor/js/ui/diff.js b/editor/js/ui/diff.js index eb822df1e..b5af903a0 100644 --- a/editor/js/ui/diff.js +++ b/editor/js/ui/diff.js @@ -490,7 +490,7 @@ RED.diff = (function() { } function createNodeIcon(node,def) { var nodeDiv = $("
",{class:"node-diff-node-entry-node"}); - var colour = def.color; + var colour = RED.utils.getNodeColor(node.type,def); var icon_url = RED.utils.getNodeIcon(def,node); if (node.type === 'tab') { colour = "#C0DEED"; diff --git a/editor/js/ui/editor.js b/editor/js/ui/editor.js index 16b6b65f5..e0445be54 100644 --- a/editor/js/ui/editor.js +++ b/editor/js/ui/editor.js @@ -745,7 +745,7 @@ RED.editor = (function() { icons.forEach(function(icon) { var iconDiv = $('
',{class:"red-ui-icon-list-icon"}).appendTo(iconList); var nodeDiv = $('
',{class:"red-ui-search-result-node"}).appendTo(iconDiv); - var colour = node._def.color; + var colour = RED.utils.getNodeColor(node.type, node._def); var icon_url = "icons/"+moduleName+"/"+icon; iconDiv.data('icon',icon_url) nodeDiv.css('backgroundColor',colour); @@ -816,7 +816,7 @@ RED.editor = (function() { var iconButton = $('