aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-02 17:23:44 +0300
committerGravatar Vitaly Takmazov2016-11-02 17:23:44 +0300
commit38cf47b815f820d9745d7ede6b1f40811b98d52f (patch)
tree23df22f62208cc99f7776413d76c4d107a9eb1de /juick-www/src/main
parente6e51acf09648ffb94eeecfa74a180e25b784e67 (diff)
parent38071510b3888f5a4edb31705953a0995256d882 (diff)
Merge branch 'master' of ssh://den.jabber.ru:2205/var/lib/git/com.juick.http.www
Diffstat (limited to 'juick-www/src/main')
-rw-r--r--juick-www/src/main/java/com/juick/www/Settings.java3
-rw-r--r--juick-www/src/main/static/scripts.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Settings.java b/juick-www/src/main/java/com/juick/www/Settings.java
index 5a159362..67f001b6 100644
--- a/juick-www/src/main/java/com/juick/www/Settings.java
+++ b/juick-www/src/main/java/com/juick/www/Settings.java
@@ -46,6 +46,7 @@ import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
@@ -163,7 +164,7 @@ public class Settings {
Path ao = Paths.get(imgPath, "ao", originalName);
Path a = Paths.get(imgPath, "a", targetName);
Path as = Paths.get(imgPath, "as", targetName);
- Files.move(Paths.get(Utils.getTmpDir(), avatarTmpPath), ao);
+ Files.move(Paths.get(Utils.getTmpDir(), avatarTmpPath), ao, StandardCopyOption.REPLACE_EXISTING);
Thumbnails.of(ao.toFile()).size(96, 96).toFile(a.toFile());
Thumbnails.of(ao.toFile()).size(32, 32).toFile(as.toFile());
}
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index ebeba198..d368cacd 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -657,7 +657,7 @@ ready(function () {
});
document.querySelectorAll('.ir a').forEach(function(e) {
e.addEventListener('click', function (e) {
- var fname = e.target.parentNode.getAttribute('data-fname');
+ var fname = e.target.closest('[data-fname]').getAttribute('data-fname');
if (!showPhotoDialog(fname)) {
e.preventDefault();
}