From 064f13f3ab55c1704abf45b2f70afb20c7f7cd24 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 8 Jan 2010 14:23:37 +0000 Subject: [PATCH] Stores geo view's minimized state in a cookie --- js/util.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/js/util.js b/js/util.js index 9c6342ffe7..72750c0271 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);