From a0f7896f22b93caedf4cfcb91b14a25c0c1e6a82 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Jan 2010 13:44:32 +0000 Subject: Ran NoticeLocationAttach() through jslint --- js/util.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'js/util.js') diff --git a/js/util.js b/js/util.js index 020031422..2d108118a 100644 --- a/js/util.js +++ b/js/util.js @@ -442,6 +442,15 @@ var SN = { // StatusNet }, NoticeLocationAttach: function() { + 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(''); + } + var NDG = $('#'+SN.C.S.NoticeDataGeo); if (NDG.length > 0) { var NLE = $('#notice_data-location_wrap'); @@ -460,7 +469,7 @@ var SN = { // StatusNet } var S = '
'; - NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); + var NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); if (NDGS.length > 0) { NDGS.replaceWith(S); } @@ -470,7 +479,7 @@ var SN = { // StatusNet NDGS = $('#'+SN.C.S.NoticeDataGeoSelected); NDGS.prepend('Geo'); - NLN = $('#'+SN.C.S.NoticeLocationName); + var NLN = $('#'+SN.C.S.NoticeLocationName); if ($('#'+SN.C.S.NoticeDataGeo).attr('checked') === true) { NLN.addClass('processing'); @@ -504,6 +513,7 @@ var SN = { // StatusNet }; $.getJSON(geocodeURL, data, function(location) { + NLN = $('#'+SN.C.S.NoticeLocationName); NLN.replaceWith(''); NLN = $('#'+SN.C.S.NoticeLocationName); @@ -542,22 +552,12 @@ var SN = { // StatusNet else { removeNoticeDataGeo(); } - }); + }).change(); var cookieVal = $.cookie(SN.C.S.NoticeLocationCookieName); - NDG.attr('checked', (cookieVal == null || cookieVal == 'true')); - NDG.change(); + NDG.attr('checked', (cookieVal === null || cookieVal == 'true')); } } - - 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