frame: remove dead code in Folder
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/888/head
parent
4f51e866c4
commit
1439160b50
|
@ -5,7 +5,6 @@
|
||||||
:class="{
|
:class="{
|
||||||
hasPreview: previews.length > 0,
|
hasPreview: previews.length > 0,
|
||||||
onePreview: previews.length === 1,
|
onePreview: previews.length === 1,
|
||||||
hasError: error,
|
|
||||||
}"
|
}"
|
||||||
:to="target"
|
:to="target"
|
||||||
>
|
>
|
||||||
|
@ -48,13 +47,6 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => ({
|
|
||||||
// Separate property because the one on data isn't reactive
|
|
||||||
previews: [] as IPhoto[],
|
|
||||||
// Error occured fetching thumbs
|
|
||||||
error: false,
|
|
||||||
}),
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
/** Open folder */
|
/** Open folder */
|
||||||
target() {
|
target() {
|
||||||
|
@ -70,35 +62,22 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
previews(): IPhoto[] {
|
||||||
this.refreshPreviews();
|
const previews = this.data.previews;
|
||||||
},
|
if (!previews?.length) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
watch: {
|
if (previews.length > 0 && previews.length < 4) {
|
||||||
data() {
|
return [previews[0]];
|
||||||
this.refreshPreviews();
|
} else {
|
||||||
|
return previews.slice(0, 4);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
/** Refresh previews */
|
|
||||||
refreshPreviews() {
|
|
||||||
// Reset state
|
|
||||||
this.error = false;
|
|
||||||
|
|
||||||
// Get preview infos
|
|
||||||
const previews = this.data.previews;
|
|
||||||
if (previews) {
|
|
||||||
if (previews.length > 0 && previews.length < 4) {
|
|
||||||
this.previews = [previews[0]];
|
|
||||||
} else {
|
|
||||||
this.previews = previews.slice(0, 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Get preview url */
|
/** Get preview url */
|
||||||
previewUrl(info: IPhoto) {
|
previewUrl(info: IPhoto) {
|
||||||
return utils.getPreviewUrl({
|
return utils.getPreviewUrl({
|
||||||
|
@ -162,16 +141,6 @@ export default defineComponent({
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make it red if has an error
|
|
||||||
.folder.hasError > & {
|
|
||||||
.folder-icon {
|
|
||||||
filter: invert(12%) sepia(62%) saturate(5862%) hue-rotate(8deg) brightness(103%) contrast(128%);
|
|
||||||
}
|
|
||||||
.name {
|
|
||||||
color: #bb0000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .folder-icon {
|
> .folder-icon {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 90%;
|
height: 90%;
|
||||||
|
|
Loading…
Reference in New Issue