Browse Source

Implemented image preview using uiv modal

pull/170/head
Michael Olund 5 years ago
parent
commit
468be5aa69
2 changed files with 28 additions and 4 deletions
  1. +28
    -3
      vue/src/components/ItemTile.vue
  2. +0
    -1
      vue/src/pages/initial-filing/InitialFiling.vue

+ 28
- 3
vue/src/components/ItemTile.vue View File

@ -29,6 +29,9 @@
<div class="alert alert-danger" style="padding: 4px; margin-bottom: 0" v-if="file.error">Upload Error</div> <div class="alert alert-danger" style="padding: 4px; margin-bottom: 0" v-if="file.error">Upload Error</div>
</div> </div>
</div> </div>
<modal v-model="showModal" ref="modal" :footer="false">
<img v-if="file.objectURL && !file.error && file.type !== 'application/pdf'" :src="file.objectURL" :style="imageStyle">
</modal>
</div> </div>
<div v-else> <div v-else>
<ProgressBar :file="file"/> <ProgressBar :file="file"/>
@ -37,6 +40,7 @@
<script> <script>
import ProgressBar from './ProgressBar' import ProgressBar from './ProgressBar'
import { Modal } from 'uiv';
export default { export default {
props: { props: {
@ -44,13 +48,19 @@ export default {
index: Number, index: Number,
fileCount: Number fileCount: Number
}, },
data: function () {
return {
showModal: false,
}
},
components: { components: {
ProgressBar
ProgressBar,
Modal
}, },
methods: { methods: {
showImage($event) { showImage($event) {
if ($event.target.tagName !== 'I' && $event.target.tagName !== 'BUTTON') { if ($event.target.tagName !== 'I' && $event.target.tagName !== 'BUTTON') {
alert(this.file.objectURL);
this.showModal = true;
} }
} }
}, },
@ -123,7 +133,7 @@ export default {
content: "\f06e"; content: "\f06e";
position: absolute; position: absolute;
left: 58px; left: 58px;
top: 65px;
top: 52px;
font-size: 43px; font-size: 43px;
color: transparent; color: transparent;
} }
@ -222,3 +232,18 @@ export default {
} }
} }
</style> </style>
<style lang="css">
.modal-content {
background-color: inherit;
box-shadow: none;
-webket-box-shadow: none;
border: none;
}
.modal-content button.close {
font-size: 80px;
margin-right: 75px;
margin-bottom: -100px;
}
</style>

+ 0
- 1
vue/src/pages/initial-filing/InitialFiling.vue View File

@ -118,7 +118,6 @@
<script> <script>
import Uploader from '../../components/Uploader.vue'; import Uploader from '../../components/Uploader.vue';
import Forms from "../../utils/forms";
export default { export default {
name: 'App', name: 'App',


Loading…
Cancel
Save