소스 검색

Anomalie #132: Routine de check

bastien 13 년 전
부모
커밋
674ec44a79
1개의 변경된 파일22개의 추가작업 그리고 19개의 파일을 삭제
  1. 22 19
      web/bundles/muzichcore/js/muzich.js

+ 22 - 19
web/bundles/muzichcore/js/muzich.js 파일 보기

1171
   
1171
   
1172
   function check_new_elements()
1172
   function check_new_elements()
1173
   {
1173
   {
1174
-    var url = url_element_new_count
1175
-      +'/'
1176
-      +str_replace('element_', '', $('ul.elements li:first').attr('id'))
1177
-    ;
1178
-    $.getJSON(url, function(response){
1179
-      
1180
-      if (response.status == 'mustbeconnected')
1181
-      {
1182
-        $(location).attr('href', url_index);
1183
-      }
1184
-      
1185
-      if (response.status == 'success' && response.count)
1186
-      {
1187
-        $('div.display_more_elements').show();
1188
-        $('div.display_more_elements span').html(response.message);
1189
-      }
1190
-      
1191
-      setTimeout(check_new_elements, 300000);
1192
-    });
1174
+    if ($('ul.elements li').length)
1175
+    {
1176
+      var url = url_element_new_count
1177
+        +'/'
1178
+        +str_replace('element_', '', $('ul.elements li:first').attr('id'))
1179
+      ;
1180
+      $.getJSON(url, function(response){
1181
+
1182
+        if (response.status == 'mustbeconnected')
1183
+        {
1184
+          $(location).attr('href', url_index);
1185
+        }
1186
+
1187
+        if (response.status == 'success' && response.count)
1188
+        {
1189
+          $('div.display_more_elements').show();
1190
+          $('div.display_more_elements span').html(response.message);
1191
+        }
1192
+
1193
+        setTimeout(check_new_elements, 300000);
1194
+      });
1195
+    }
1193
   }
1196
   }
1194
   
1197
   
1195
   if ($('div.display_more_elements').length)
1198
   if ($('div.display_more_elements').length)