show big picture of dashboard items

This commit is contained in:
2018-04-29 08:36:49 +02:00
parent 022d5a21c5
commit b4d93414f5
2 changed files with 70 additions and 8 deletions

View File

@@ -201,6 +201,30 @@ textarea {
} }
#result-view-dashboard-image-viewer {
position: absolute;
top: 0;
left: 0;
bottom:0;
z-index: 1;
overflow-y:hidden;
}
#result-view-dashboard-image-viewer img{
display:block; /* removes 3 pixels extra height around the image */
}
#result-view-dashboard-image-viewer-close {
position: absolute;
top: 0;
right: 0;
font-size: 2em;
opacity: 0.3;
}
#result-view-dashboard-image-viewer-close:hover {
opacity: 1.0;
}
#navigation-bar-dashboard div { #navigation-bar-dashboard div {
float: left; float: left;
} }
@@ -234,3 +258,7 @@ input:required:invalid {
.icon-abort:hover { .icon-abort:hover {
color: #ff6b6b; color: #ff6b6b;
} }
.clickable {
cursor: pointer;
}

View File

@@ -218,25 +218,57 @@ Vue.component('result-view', {
Vue.component('result-view-dashboard', { Vue.component('result-view-dashboard', {
props: ['dashboard'], props: ['dashboard'],
methods: { methods: {
closeImage: function() {
this.dashboard.image = "";
}
}, },
template: ` template: `
<div id="result-view-dashboard" <div id="result-view-dashboard"
v-if="dashboard.tiles"> v-if="dashboard.tiles">
<result-view-dashboard-item <div v-show="!dashboard.image">
v-for="item in dashboard.tiles" <result-view-dashboard-item
v-bind:key="item.fieldValue" v-for="item in dashboard.tiles"
v-bind:dashboardItem="item" v-bind:key="item.fieldValue"
></result-view-dashboard-item> v-bind:dashboardItem="item"
></result-view-dashboard-item>
</div>
<div
id="result-view-dashboard-image-viewer"
v-if="dashboard.image">
<img
v-bind:src="dashboard.image"
/>
<div
id="result-view-dashboard-image-viewer-close"
class="clickable"
@click="closeImage"
title="Close"
><i class="fa fa-times" aria-hidden="true" /></div>
</div>
</div> </div>
` `
}); });
Vue.component('result-view-dashboard-item', { Vue.component('result-view-dashboard-item', {
props: ['dashboardItem'], props: ['dashboardItem'],
methods: {
showImage: function(){
var vm = this;
data.dashboard.image = this.dashboardItem.imageUrl;
}
},
template: ` template: `
<div class="dashboard-item"> <div class="dashboard-item">
<div class="error-message" v-if="dashboardItem.error">{{ dashboardItem.error }}</div> <div class="error-message" v-if="dashboardItem.error">{{ dashboardItem.error }}</div>
<img v-bind:src="dashboardItem.thumbnailUrl" v-if="dashboardItem.thumbnailUrl" /> <a
v-bind:href="dashboardItem.imageUrl"
v-on:click.prevent.stop
><img
v-if="dashboardItem.thumbnailUrl"
v-bind:src="dashboardItem.thumbnailUrl"
class="clickable"
@click="showImage"
/></a>
<div class="fieldValue">{{ dashboardItem.fieldValue }} ({{ dashboardItem.stats.values }}) ({{ dashboardItem.stats.maxValue }})</div> <div class="fieldValue">{{ dashboardItem.fieldValue }} ({{ dashboardItem.stats.values }}) ({{ dashboardItem.stats.maxValue }})</div>
</div>` </div>`
}); });
@@ -763,6 +795,7 @@ var data = {
dashboard: { dashboard: {
tiles: [], tiles: [],
toBeRendered: [], toBeRendered: [],
image: "",
sortBy: "MAX_VALUE_DESC", sortBy: "MAX_VALUE_DESC",
filter: "NONE", filter: "NONE",
progress: { progress: {
@@ -792,6 +825,7 @@ function hidePlotAndDashboard()
data.resultView.imageUrl = ''; data.resultView.imageUrl = '';
data.resultView.errorMessage = ''; data.resultView.errorMessage = '';
data.dashboard.tiles = []; data.dashboard.tiles = [];
data.dashboard.image = "";
} }
function plotCurrent() function plotCurrent()
@@ -905,8 +939,8 @@ function createDashboard(vm){
hidePlotAndDashboard(); hidePlotAndDashboard();
const imageHeight = Math.floor($('#app').height() - $('#search-bar').height() - $('#navigation').height()); const imageHeight = Math.floor($('#app').height() - Math.ceil($('#search-bar').outerHeight()) - Math.ceil($('#navigation-bar').outerHeight()));
const imageWidth = Math.floor($('#app').width()- $('#search-bar').width() - $('#navigation').width()); const imageWidth = Math.floor($('#app').width());
const originalQuery = data.searchBar.query; const originalQuery = data.searchBar.query;
vm.splitQueries(function (fieldValues) { vm.splitQueries(function (fieldValues) {