]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Stores geo view's minimized state in a cookie
authorSarven Capadisli <csarven@status.net>
Fri, 8 Jan 2010 14:23:37 +0000 (14:23 +0000)
committerSarven Capadisli <csarven@status.net>
Fri, 8 Jan 2010 14:23:37 +0000 (14:23 +0000)
js/util.js

index 9c6342ffe77a5a95d8dc81d4c9e2981a089d917c..72750c0271853edc492a68607783bac0a8895f6d 100644 (file)
@@ -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);