From ad323575e6c083417fc4e6fc1e253bc9d564e6b2 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 10:07:32 +0000 Subject: Refactored geo location removal to removeNoticeDataGeo() --- js/util.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'js') diff --git a/js/util.js b/js/util.js index c1cc08a71..226fdb102 100644 --- a/js/util.js +++ b/js/util.js @@ -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() { -- cgit v1.2.3-54-g00ecf