This repository was archived by the owner on Jan 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,11 @@ function createLinkForEachEntry(archive) {
84
84
// Add a link to the Object URL
85
85
var a = document . createElement ( 'a' ) ;
86
86
a . innerHTML = entry . name + ' (' + toFriendlySize ( entry . size ) + ')' ;
87
- a . href = entry . name ;
87
+ a . href = '#' + entry . name ;
88
88
89
89
// Uncompress the entry when the link is clicked on
90
90
a . addEventListener ( 'click' , function ( e ) {
91
91
console . info ( 'clicked .................' ) ;
92
- e . preventDefault ( ) ;
93
92
onClick ( entry ) ;
94
93
} ) ;
95
94
@@ -111,6 +110,10 @@ window.onload = function() {
111
110
return ;
112
111
}
113
112
113
+ // Remove any loaded image
114
+ window . location . hash = '' ;
115
+ document . getElementById ( 'currentImage' ) . src = '' ;
116
+
114
117
// Get the file's info
115
118
var file = file_input . files [ 0 ] ;
116
119
Original file line number Diff line number Diff line change @@ -37,12 +37,11 @@ window.onload = function() {
37
37
38
38
// Add a link to the Object URL
39
39
var a = document . createElement ( 'a' ) ;
40
- a . href = url ;
40
+ a . href = '#' + file_name ;
41
41
a . innerHTML = file_name + ' (' + toFriendlySize ( size ) + ')' ;
42
42
a . addEventListener ( 'click' , function ( e ) {
43
- e . preventDefault ( ) ;
44
43
var img = document . getElementById ( 'currentImage' ) ;
45
- img . src = this . href ;
44
+ img . src = url ;
46
45
} ) ;
47
46
48
47
entryList . appendChild ( a ) ;
@@ -63,6 +62,10 @@ window.onload = function() {
63
62
}
64
63
entryList . innerHTML = '' ;
65
64
65
+ // Remove any loaded image
66
+ window . location . hash = '' ;
67
+ document . getElementById ( 'currentImage' ) . src = '' ;
68
+
66
69
// Get the file's info
67
70
var file = file_input . files [ 0 ] ;
68
71
var blob = file . slice ( ) ;
You can’t perform that action at this time.
0 commit comments