]> git.scottworley.com Git - picsort/blobdiff - picsorter.js
move_to_nondeleted() calls setpic()
[picsort] / picsorter.js
index ae4c8377453caa1c1d80d6456b8d3d4de6dbd572..d721ac4eeae7e93a31cbeb3ba528b2665e54dace 100644 (file)
@@ -12,7 +12,6 @@ localStorage.picsorter_picinfo = JSON.stringify(picinfo);
 var exposure = 20;
 var zoom = "sm/";
 var input_index = -1;
-move_to_nondeleted(1);
 
 
 function setpic() {
@@ -43,6 +42,7 @@ function move_to_nondeleted(direction) {
     input_index += direction;
   } while (picinfo[files[input_index]].deleted);
   say(input_index);
+  setpic();
 }
 
 function mark_deleted() {
@@ -58,13 +58,13 @@ function mark_not_deleted() {
 }
 
 $(function() {
-  setpic();
+  move_to_nondeleted(1);
 });
 
 Mousetrap.bind('z', toggle_zoom);
 Mousetrap.bind('Z', function() { $("#pic").toggleClass("fit_view"); });
-Mousetrap.bind('n', function() { move_to_nondeleted(1); setpic(); });
-Mousetrap.bind('p', function() { move_to_nondeleted(-1); setpic(); });
+Mousetrap.bind('n', function() { move_to_nondeleted(1); });
+Mousetrap.bind('p', function() { move_to_nondeleted(-1); });
 Mousetrap.bind('N', function() { input_index ++; say(input_index); setpic(); });
 Mousetrap.bind('P', function() { input_index --; say(input_index); setpic(); });
 Mousetrap.bind('b', function() { exposure ++; say_exposure(); setpic(); });