Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Fix media browser mime type icon styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Marttin Notta committed Jun 18, 2021
1 parent d3ca782 commit 8d298af
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/js/components/IndexFileField.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="p-2 mime-type-icon-wrapper">
<div class="mime-type-icon-wrapper">
<mime-type-icon :src="fileThumbnail" :mime-type="mimeType" />
</div>
</template>
Expand Down
32 changes: 31 additions & 1 deletion resources/js/components/MediaBrowsingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
:currentCollection="currentCollection"
/>

<div :class="`flex mb-6`" id="media-dropzone" v-if="!loadingMediaFiles">
<div :class="`flex mb-6`" id="media-dropzone" class="media-dropzone-wrapper" v-if="!loadingMediaFiles">
<div class="img-collection" @scroll="scrollEventListener" ref="imgCollectionRef">
<div class="empty-message" v-if="files.length === 0 && !uploadOnly">
<p>There are currently no media files in this library</p>
Expand Down Expand Up @@ -500,3 +500,33 @@ export default {
},
};
</script>
<style lang="scss">
.od-modal {
height: 88vh;
> div:first-child {
height: calc(88vh - 60px);
> div {
height: calc(88vh - 60px - 110px);
}
}
#media-dropzone .img-collection {
height: 100%;
max-height: none;
}
.media-dropzone-wrapper {
height: 100%;
}
.mime-type-icon {
padding: 24px;
svg {
position: static;
}
}
}
</style>
6 changes: 3 additions & 3 deletions resources/js/components/MimeTypeIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
:src="src"
@error="isImageFileMissing = true"
/>
<missing-file-icon v-else-if="isImageFile && isImageFileMissing" class="p-2" />
<audio-icon v-else-if="isAudioFile" class="p-2" />
<thumbnail-video-icon v-else-if="isVideoFile && !showVideo" icon="video-icon" class="p-2" />
<missing-file-icon v-else-if="isImageFile && isImageFileMissing" />
<audio-icon v-else-if="isAudioFile" />
<thumbnail-video-icon v-else-if="isVideoFile && !showVideo" icon="video-icon" />
<video v-else-if="isVideoFile && showVideo" controls>
<source :src="src" :type="mimeType" />
</video>
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/UploadedFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ export default {
text-align: center;
}
.mime-type-icon {
padding: 16px;
}
&:hover {
.thumbnail-container {
box-shadow: 0 0 5px rgba(#4099de, 0.5);
Expand Down

0 comments on commit 8d298af

Please sign in to comment.