Merge pull request from vincentbriglia/issue1552

Allow override of icons per block
This commit is contained in:
Chris Willis-Ford 2018-05-25 01:10:57 -07:00 committed by GitHub
commit b3db00fab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -649,11 +649,15 @@ class Runtime extends EventEmitter {
};
// If an icon for the extension exists, prepend it to each block, with a vertical separator.
if (categoryInfo.blockIconURI) {
// We can overspecify an icon for each block, but if no icon exists on a block, fall back to
// the category block icon.
const iconURI = blockInfo.blockIconURI || categoryInfo.blockIconURI;
if (iconURI) {
blockJSON.message0 = '%1 %2';
const iconJSON = {
type: 'field_image',
src: categoryInfo.blockIconURI,
src: iconURI,
width: 40,
height: 40
};