Browse Source

Fix upload more than 10 media

master
morethanwords 4 years ago
parent
commit
0760bbaf0f
  1. 4
      src/components/popupNewMedia.ts
  2. 2
      src/components/wrappers.ts
  3. 14
      src/scss/partials/_document.scss
  4. 4
      src/scss/partials/popups/_mediaAttacher.scss

4
src/components/popupNewMedia.ts

@ -210,6 +210,10 @@ export default class PopupNewMedia extends PopupElement { @@ -210,6 +210,10 @@ export default class PopupNewMedia extends PopupElement {
const container = this.container;
const willAttach = this.willAttach;
if(files.length > 10 && willAttach.type == 'media') {
willAttach.type = 'document';
}
files = files.filter(file => {
if(willAttach.type == 'media') {
return ['image/', 'video/'].find(s => file.type.indexOf(s) === 0);

2
src/components/wrappers.ts

@ -318,7 +318,7 @@ export function wrapDocument(doc: MyDocument, withTime = false, uploading = fals @@ -318,7 +318,7 @@ export function wrapDocument(doc: MyDocument, withTime = false, uploading = fals
icoDiv.classList.add('document-ico');
if(doc.thumbs?.length || (uploading && doc.url)) {
docDiv.classList.add('photo');
docDiv.classList.add('document-with-thumb');
if(uploading) {
icoDiv.innerHTML = `<img src="${doc.url}">`;

14
src/scss/partials/_document.scss

@ -6,7 +6,10 @@ @@ -6,7 +6,10 @@
background-color: $color-blue;
border-radius: .5rem;
line-height: 10px;
padding: 0 .25rem;
.document:not(.document-with-thumb) & {
padding: 1.5rem .25rem 0 .25rem;
}
&:after {
content: "";
@ -60,14 +63,7 @@ @@ -60,14 +63,7 @@
}
}
&:not(.photo) {
.document-ico {
padding-top: 1.5rem;
//background-image: url('../assets/img/doc-in.svg');
}
}
&.photo {
&.document-with-thumb {
.document-ico {
background: #000;
border-radius: $border-radius;

4
src/scss/partials/popups/_mediaAttacher.scss

@ -34,11 +34,7 @@ @@ -34,11 +34,7 @@
> div {
position: absolute;
}
}
}
&.is-document, &.is-album {
#{$parent}-photo {
img, video {
object-fit: cover;
width: 100%;

Loading…
Cancel
Save