Skip to content

Commit 6ca6daa

Browse files
committed
back button for mobile handling. maybe?
1 parent 9564c86 commit 6ca6daa

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

js/app.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ function lhash_update(history_step) {
4343
if(wvar.nena) {
4444
hash += "&nena=1";
4545
}
46+
if(wvar.box) { // We just need something to change so we can trigger the back button correctly
47+
hash += "&box="+wvar.box;
48+
}
4649

4750
hash = encodeURI(hash);
4851
// set state
@@ -70,6 +73,7 @@ var wvar = {
7073
nyan: false,
7174
nena: false,
7275
site: 0,
76+
box: "aboutbox"
7377
};
7478

7579

@@ -93,6 +97,7 @@ function load_hash(no_refresh) {
9397
query: "",
9498
nyan: false,
9599
nena: false,
100+
box: ""
96101
};
97102

98103
parms.forEach(function(v) {
@@ -141,6 +146,9 @@ function load_hash(no_refresh) {
141146
focusID = v;
142147
gotoSite(v);
143148
break;
149+
case "box":
150+
def[k] = v;
151+
break;
144152
}
145153
});
146154

@@ -149,6 +157,19 @@ function load_hash(no_refresh) {
149157
if(wvar[k] != def[k]) refresh = true;
150158
});
151159

160+
if (wvar["box"] != def["box"]){
161+
console.log("box change detected")
162+
if(!def["box"]){
163+
$(".flatpage").hide()
164+
} else {
165+
$(".flatpage").hide()
166+
$("#"+def["box"]).show()
167+
}
168+
checkSize();
169+
wvar["box"]= def["box"];
170+
171+
}
172+
152173
$.extend(true, wvar, def);
153174

154175
// force refresh
@@ -642,6 +663,14 @@ $(window).ready(function() {
642663
default: pretty_name = name[0].toUpperCase() + name.slice(1);
643664
}
644665
}
666+
var visible_box = $(".flatpage:visible");
667+
if (visible_box.length > 0){
668+
wvar.box = visible_box[0].id
669+
console.log(wvar.box)
670+
} else {
671+
wvar.box = null
672+
}
673+
lhash_update(true);
645674
checkSize();
646675
});
647676

0 commit comments

Comments
 (0)