diff --git a/README.md b/README.md
index a7362ea..6131c79 100644
--- a/README.md
+++ b/README.md
@@ -59,3 +59,4 @@ Keyboard shortcuts:
| `=` | Mode: Tile larger
| `L` | Mode: Show / Hide label
| `P` | Menu: Pin / Unpin menu
+| `S` | Menu: Toggle sort mode
diff --git a/webize b/webize
index b2b8b74..4339b40 100755
--- a/webize
+++ b/webize
@@ -135,7 +135,7 @@ if [ -n "$GALLERY" ]; then
🦕
🏷
📌
-
+
@@ -340,6 +340,10 @@ cat - >> "$indexHtm" <<'EOF'
if (keyCode === 80) {
togglePinHandler();
}
+ // s key
+ if (keyCode === 83) {
+ toggleSortMode();
+ }
// console.log(keyCode);
};
@@ -523,7 +527,7 @@ cat - >> "$indexHtm" <<'EOF'
}
};
- var setMode = function(value) {
+ var setMode = function(value, preserve) {
var modePrev = mode;
if (value) {
mode = value;
@@ -537,16 +541,16 @@ cat - >> "$indexHtm" <<'EOF'
break;
case "tilesmaller":
if (modePrev === "tilesmaller" || modePrev === "tilelarger") {
- tilesmaller();
+ tilesmaller(preserve);
}else {
tilesmaller(true);
}
break;
case "tilelarger":
if (modePrev === "tilesmaller" || modePrev === "tilelarger") {
- tilelarger();
+ tilesmaller(preserve);
}else {
- tilelarger(true);
+ tilesmaller(true);
}
break;
default:
@@ -633,7 +637,7 @@ cat - >> "$indexHtm" <<'EOF'
var sort = function(sortMode) {
createImageComponents(sortMode);
- setMode(mode);
+ setMode(mode, true);
}
var keyHandler = function(event) {