summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-08 14:23:37 +0000
committerSarven Capadisli <csarven@status.net>2010-01-08 14:23:37 +0000
commit064f13f3ab55c1704abf45b2f70afb20c7f7cd24 (patch)
tree00e78a493e443cc465aa6aa4deb6e4a7f0b42f18 /js
parent54c18e68dadc37174e8631db76dae064a88920a6 (diff)
Stores geo view's minimized state in a cookie
Diffstat (limited to 'js')
-rw-r--r--js/util.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/js/util.js b/js/util.js
index 9c6342ffe..72750c027 100644
--- a/js/util.js
+++ b/js/util.js
@@ -521,7 +521,8 @@ var SN = { // StatusNet
'NLID': lid,
'NLN': NLN_text,
'NLNU': location.url,
- 'NDG': true
+ 'NDG': true,
+ 'NDGSM': false
};
$.cookie(SN.C.S.NoticeDataGeo, JSON.stringify(cookieValue));
});
@@ -577,6 +578,18 @@ var SN = { // StatusNet
$('#'+SN.C.S.NoticeDataGeoSelected+' button.minimize').click(function(){
$('#'+SN.C.S.NoticeDataGeoSelected).hide();
+ var cookieValue = {
+ 'NLat': $('#'+SN.C.S.NoticeLat).val(),
+ 'NLon': $('#'+SN.C.S.NoticeLat).val(),
+ 'NLNS': $('#'+SN.C.S.NoticeLocationNs).val(),
+ 'NLID': $('#'+SN.C.S.NoticeLocationId).val(),
+ 'NLN': $('#'+SN.C.S.NoticeGeoName).text(),
+ 'NLNU': $('#'+SN.C.S.NoticeGeoName).attr('href'),
+ 'NDG': true,
+ 'NDGSM': true
+ };
+ $.cookie(SN.C.S.NoticeDataGeo, JSON.stringify(cookieValue));
+
return false;
});
@@ -622,6 +635,11 @@ var SN = { // StatusNet
}
else {
var cookieValue = JSON.parse($.cookie(SN.C.S.NoticeDataGeo));
+
+ if (cookieValue.NDGSM === true) {
+ $('#'+SN.C.S.NoticeDataGeoSelected).hide();
+ }
+
$('#'+SN.C.S.NoticeLat).val(cookieValue.NLat);
$('#'+SN.C.S.NoticeLon).val(cookieValue.NLon);
$('#'+SN.C.S.NoticeLocationNs).val(cookieValue.NLNS);