show big picture of dashboard items
This commit is contained in:
@@ -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 {
|
||||
float: left;
|
||||
}
|
||||
@@ -234,3 +258,7 @@ input:required:invalid {
|
||||
.icon-abort:hover {
|
||||
color: #ff6b6b;
|
||||
}
|
||||
|
||||
.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -218,25 +218,57 @@ Vue.component('result-view', {
|
||||
Vue.component('result-view-dashboard', {
|
||||
props: ['dashboard'],
|
||||
methods: {
|
||||
closeImage: function() {
|
||||
this.dashboard.image = "";
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div id="result-view-dashboard"
|
||||
v-if="dashboard.tiles">
|
||||
<result-view-dashboard-item
|
||||
v-for="item in dashboard.tiles"
|
||||
v-bind:key="item.fieldValue"
|
||||
v-bind:dashboardItem="item"
|
||||
></result-view-dashboard-item>
|
||||
<div v-show="!dashboard.image">
|
||||
<result-view-dashboard-item
|
||||
v-for="item in dashboard.tiles"
|
||||
v-bind:key="item.fieldValue"
|
||||
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>
|
||||
`
|
||||
});
|
||||
|
||||
Vue.component('result-view-dashboard-item', {
|
||||
props: ['dashboardItem'],
|
||||
methods: {
|
||||
showImage: function(){
|
||||
var vm = this;
|
||||
data.dashboard.image = this.dashboardItem.imageUrl;
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="dashboard-item">
|
||||
<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>`
|
||||
});
|
||||
@@ -763,6 +795,7 @@ var data = {
|
||||
dashboard: {
|
||||
tiles: [],
|
||||
toBeRendered: [],
|
||||
image: "",
|
||||
sortBy: "MAX_VALUE_DESC",
|
||||
filter: "NONE",
|
||||
progress: {
|
||||
@@ -792,6 +825,7 @@ function hidePlotAndDashboard()
|
||||
data.resultView.imageUrl = '';
|
||||
data.resultView.errorMessage = '';
|
||||
data.dashboard.tiles = [];
|
||||
data.dashboard.image = "";
|
||||
}
|
||||
|
||||
function plotCurrent()
|
||||
@@ -905,8 +939,8 @@ function createDashboard(vm){
|
||||
|
||||
hidePlotAndDashboard();
|
||||
|
||||
const imageHeight = Math.floor($('#app').height() - $('#search-bar').height() - $('#navigation').height());
|
||||
const imageWidth = Math.floor($('#app').width()- $('#search-bar').width() - $('#navigation').width());
|
||||
const imageHeight = Math.floor($('#app').height() - Math.ceil($('#search-bar').outerHeight()) - Math.ceil($('#navigation-bar').outerHeight()));
|
||||
const imageWidth = Math.floor($('#app').width());
|
||||
|
||||
const originalQuery = data.searchBar.query;
|
||||
vm.splitQueries(function (fieldValues) {
|
||||
|
||||
Reference in New Issue
Block a user