]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Refactored geo location removal to removeNoticeDataGeo()
authorSarven Capadisli <csarven@status.net>
Mon, 4 Jan 2010 10:07:32 +0000 (10:07 +0000)
committerSarven Capadisli <csarven@status.net>
Mon, 4 Jan 2010 10:07:32 +0000 (10:07 +0000)
js/util.js

index c1cc08a7145ec24e395d7139d8ecde756afbb5d0..226fdb102c9a0057316d21337eb0d7cc36f77819 100644 (file)
@@ -535,23 +535,13 @@ var SN = { // StatusNet
 
                                 function(error) {
                                     if (error.PERMISSION_DENIED == 1) {
-                                        $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
-                                        NDGS.hide();
-                                        $('#'+SN.C.S.NoticeLat).val('');
-                                        $('#'+SN.C.S.NoticeLon).val('');
-                                        $('#'+SN.C.S.NoticeLocationNs).val('');
-                                        $('#'+SN.C.S.NoticeLocationId).val('');
+                                        removeNoticeDataGeo();
                                     }
                                 }
                             );
                         }
                         else {
-                            $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
-                            NDGS.hide();
-                            $('#'+SN.C.S.NoticeLat).val('');
-                            $('#'+SN.C.S.NoticeLon).val('');
-                            $('#'+SN.C.S.NoticeLocationNs).val('');
-                            $('#'+SN.C.S.NoticeLocationId).val('');
+                            removeNoticeDataGeo();
                         }
                     });
 
@@ -560,6 +550,15 @@ var SN = { // StatusNet
                     NDG.change();
                 }
             }
+
+            function removeNoticeDataGeo() {
+                $('label[for='+SN.C.S.NoticeDataGeo+']').removeClass('checked');
+                $('#'+SN.C.S.NoticeDataGeoSelected).hide();
+                $('#'+SN.C.S.NoticeLat).val('');
+                $('#'+SN.C.S.NoticeLon).val('');
+                $('#'+SN.C.S.NoticeLocationNs).val('');
+                $('#'+SN.C.S.NoticeLocationId).val('');
+            }
         },
 
         NewDirectMessage: function() {