Skip to content

Commit

Permalink
Added color filling of preset elements, except for "without"
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Helldar committed Oct 23, 2020
1 parent 78e18de commit adf5e3e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions resources/views/scripts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
items: {
base: [
{ key: 'without', value: trans.without }
{ key: 'without', value: trans.without, color: 'grey lighten-2' }
],
deprecated: [
{ key: 'only', value: trans.only },
{ key: 'without', value: trans.without }
{ key: 'without', value: trans.without, color: 'grey lighten-2' }
],
domains: [],
Expand Down Expand Up @@ -205,13 +205,21 @@
let name = route[key];
if (name !== null && ! this.inArray(result, name, 'key')) {
let color = this.getColor(result.length);
result.push({ key: name, value: name, color: color });
result.push({ key: name, value: name });
}
});
return result;
return _.map(result, (item, index) => {
if (item.color !== undefined) {
return item;
}
let color = this.getColor(index);
_.set(item, 'color', color);
return item;
});
},
getColor(index) {
Expand Down

0 comments on commit adf5e3e

Please sign in to comment.