File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ a, a:hover {
58
58
right : 10% ;
59
59
bottom : 10% ;
60
60
left : 10% ;
61
+ background : rgba (0 , 0 , 0 , 0.5 );;
62
+ transition: width 200ms, height 200ms, left 200ms;
61
63
text- align: center;
62
64
}
63
65
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ var app = function(){
37
37
function cd ( dir ) {
38
38
current_dir = dir ;
39
39
40
- console . log ( current_dir , base_dir ) ;
41
40
location . hash = current_dir . replace ( base_dir , '' ) ;
42
41
43
42
// show the location bar
@@ -91,12 +90,16 @@ var app = function(){
91
90
// show an image preview of the given file
92
91
function showPreview ( filepath ) {
93
92
$ ( ".bg-translucent" ) . css ( 'display' , 'block' ) ;
93
+ $ ( ".file-view-img" ) . css ( 'padding-top' , '2em' ) ;
94
94
$ ( ".file-view-img" ) . attr ( 'src' , 'loader.gif' ) ;
95
95
$ ( ".file-view-wrapper" ) . css ( 'display' , 'block' ) ;
96
96
var img = new Image ( ) ;
97
97
img . src = filepath ;
98
98
img . onload = function ( ) {
99
+ $ ( ".file-view-img" ) . fadeOut ( 0 ) ;
100
+ $ ( ".file-view-img" ) . css ( 'padding-top' , '0' ) ;
99
101
$ ( ".file-view-img" ) . attr ( 'src' , filepath ) ;
102
+ $ ( ".file-view-img" ) . fadeIn ( ) ;
100
103
var scale_width = 0.8 * $ ( document ) . width ( ) / img . width ;
101
104
var scale_height = 0.8 * $ ( document ) . height ( ) / img . height ;
102
105
var imgWidth = img . width * Math . min ( scale_width , scale_height ) ;
You can’t perform that action at this time.
0 commit comments