bastien 13 лет назад
Родитель
Сommit
674ec44a79
1 измененных файлов: 22 добавлений и 19 удалений
  1. 22 19
      web/bundles/muzichcore/js/muzich.js

+ 22 - 19
web/bundles/muzichcore/js/muzich.js Просмотреть файл

@@ -1171,25 +1171,28 @@ $(document).ready(function(){
1171 1171
   
1172 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 1198
   if ($('div.display_more_elements').length)