Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit e6808e1

Browse files
author
samsep
committed
initial setup for non-images in viewer
1 parent 3c46254 commit e6808e1

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

src/.DS_Store

2 KB
Binary file not shown.

src/images/file-icon.svg

Lines changed: 23 additions & 0 deletions
Loading

src/scripts/controllers/image-viewer.controller.coffee

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ ImageViewerController = ->
1919

2020
vm.onFileChange({file: vm.file}) if vm.onFileChange
2121

22+
vm.isImage = ->
23+
pattern = new RegExp('image.*')
24+
pattern.test(vm.file.type)
25+
2226
vm.viewNext = ->
2327
update(vm.currentIndex + 1)
2428

src/styles/image-viewer.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ image-slide-viewer {
4646
max-width: 100%;
4747
max-height: 100%;
4848
}
49+
50+
.file-preview {
51+
background-color: $gray;
52+
height: 148px;
53+
width: 148px;
54+
55+
img {
56+
height: 35px;
57+
width: 35px;
58+
}
59+
}
4960
}
5061

5162
&.fit {

src/views/image-viewer.directive.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ main.flex.column.light-bg
1010
button.clean.icon.arrow
1111

1212
.image-container.flex-grow(ng-class="{ 'small' : !vm.largeImage, 'fit' : vm.largeImage && !vm.zoom, 'full elevated': vm.largeImage && vm.zoom }")
13-
img.preview-image(ng-src="{{vm.file.url}}" ng-click="vm.toggleZoom()" ng-class="{ 'elevated': !vm.largeImage || (vm.largeImage && !vm.zoom) }")
13+
img.preview-image(ng-if="vm.isImage()" ng-src="{{vm.file.url}}" ng-click="vm.toggleZoom()" ng-class="{ 'elevated': !vm.largeImage || (vm.largeImage && !vm.zoom) }")
14+
15+
a.file-preview.flex.center.middle(ng-if="!vm.isImage()")
16+
img(ng-src=require('../images/file-icon.svg'))
1417

1518
.next.flex
1619
a.arrow-next(ng-class="{invisible: !vm.nextFile}" ng-click="vm.viewNext()")

0 commit comments

Comments
 (0)