fix: fix chart filter buttons z-index

This commit is contained in:
Prssanna Desai 2019-08-08 15:28:07 +05:30
parent 0fe259d3ed
commit 17196904ef
2 changed files with 19 additions and 3 deletions

View file

@ -32,6 +32,12 @@
.heatmap-container {
height: 170px
}
.performance-heatmap {
width: 80%;
display: inline-block;
}
.performance-heatmap .chart-container {
margin-left: 30px;
}
@ -57,6 +63,10 @@
height: 130px;
}
.line-chart-container .chart-filter {
z-index: 1;
}
.recent-activity {
margin: 20px;
font-size: 12px;

View file

@ -224,7 +224,7 @@ class UserProfile {
}
},
]
this.render_chart_filters(filters, '.line-chart-container');
this.render_chart_filters(filters, '.line-chart-container', 1);
}
create_percentage_chart_filters() {
@ -255,7 +255,7 @@ class UserProfile {
this.render_chart_filters(filters, '.heatmap-container');
}
render_chart_filters(filters, container) {
render_chart_filters(filters, container, append) {
console.log(this.wrapper.find(container));
filters.forEach(filter => {
let chart_filter_html = `<div class="chart-filter pull-right">
@ -266,15 +266,21 @@ class UserProfile {
</button>
</a>`;
let options_html;
if (filter.fieldnames) {
options_html = filter.options.map((option, i) =>
`<li><a data-fieldname = "${filter.fieldnames[i]}">${option}</a></li>`).join('');
} else {
options_html = filter.options.map( option => `<li><a>${option}</a></li>`).join('');
}
let dropdown_html= chart_filter_html + `<ul class="dropdown-menu">${options_html}</ul></div>`;
let $chart_filter = $(dropdown_html);
$chart_filter.prependTo(this.wrapper.find(container));
if (append) {
$chart_filter.prependTo(this.wrapper.find(container));
} else $chart_filter.appendTo(this.wrapper.find(container));
$chart_filter.find('.dropdown-menu').on('click', 'li a', (e)=> {
let $el = $(e.currentTarget);
let fieldname;