]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - js/util.js
Added timeout error handling for geo location
[quix0rs-gnu-social.git] / js / util.js
index 0ee3d53bd52ef0f0c47556c79c251d731b4a9d45..b56410e62fe2f771083da2f74e7e618e4e481200 100644 (file)
@@ -632,9 +632,18 @@ var SN = { // StatusNet
                                     },
 
                                     function(error) {
-                                        if (error.PERMISSION_DENIED == 1) {
-                                            removeNoticeDataGeo();
+                                        switch(error.code) {
+                                            case error.PERMISSION_DENIED:
+                                                removeNoticeDataGeo();
+                                                break;
+                                            case error.TIMEOUT:
+                                                $('#'+SN.C.S.NoticeGeoName).text(NoticeDataGeo_text.ErrorTimeout).removeClass('processing');
+                                                break;
                                         }
+                                    },
+
+                                    {
+                                        timeout: 10000
                                     }
                                 );
                             }