Skip to content

Commit b529dbd

Browse files
committed
match color to section
1 parent 0fd38ca commit b529dbd

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/templates/portal-summary.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ <h1>Portal Summary</h1>
6666
tipClass:'',
6767
showDetails: false,
6868
tableData:[],
69-
filter: ''
69+
filter: '',
70+
bgColor:''
7071
}
7172
},
7273
props: ['data', 'summary_type', 'colors'],
7374
methods:{
74-
handleChartClick(label){
75+
handleChartClick(label, color){
7576
filtered = this.tableData.filter(d => d.label == label);
7677
this.filter = label;
78+
this.bgColor = color;
7779
this.showDetails = true;
7880
this.makeTable(filtered, true);
7981
},
@@ -351,7 +353,7 @@ <h1>Portal Summary</h1>
351353
},
352354
onClick: function (e, item) {
353355
if (item.length && Object.prototype.hasOwnProperty.call(item[0], '_view')) {
354-
self.handleChartClick(item[0]._view.label)
356+
self.handleChartClick(item[0]._view.label, item[0]._view.backgroundColor)
355357
}else{
356358
self.showDetails = false
357359
}
@@ -375,7 +377,7 @@ <h1>Portal Summary</h1>
375377
},
376378
onClick: function (e, item) {
377379
if (item.length && Object.prototype.hasOwnProperty.call(item[0], '_view')) {
378-
self.handleChartClick(item[0]._view.label)
380+
self.handleChartClick(item[0]._view.label, item[0]._view.backgroundColor)
379381
}else{
380382
self.showDetails = false
381383
}
@@ -409,7 +411,7 @@ <h1>Portal Summary</h1>
409411
},
410412
onClick: function (e, item) {
411413
if (item.length && Object.prototype.hasOwnProperty.call(item[0], '_view')) {
412-
self.handleChartClick(item[0]._view.label)
414+
self.handleChartClick(item[0]._view.label, item[0]._view.backgroundColor)
413415
}else{
414416
self.showDetails = false
415417
}
@@ -443,7 +445,7 @@ <h1>Portal Summary</h1>
443445
},
444446
onClick: function (e, item) {
445447
if (item.length && Object.prototype.hasOwnProperty.call(item[0], '_view')) {
446-
self.handleChartClick(item[0]._view.label)
448+
self.handleChartClick(item[0]._view.label, item[0]._view.backgroundColor)
447449
}else{
448450
self.showDetails = false
449451
}
@@ -488,9 +490,9 @@ <h1>Portal Summary</h1>
488490
<button class="smallButton"
489491
:class="showDetails ? 'red white-text-imp':'grey' "
490492
v-text="showDetails? 'Close' : 'Details' "
491-
@click="showDetails = !showDetails; makeTable(tableData);filter='All' "></button>
493+
@click="showDetails = !showDetails; makeTable(tableData);filter='All'; bgColor='grey' "></button>
492494
</div>
493-
<h6 class="white-text grey darken-2 p-1" v-show="filter && showDetails" v-text="filter"></h6>
495+
<h6 class="white-text p-1" :style="{backgroundColor: bgColor}" v-show="filter && showDetails" v-text="filter"></h6>
494496
<div v-show="showDetails" :id="summary_type+'table'"></div>
495497
</div>`
496498
});

0 commit comments

Comments
 (0)