]> git.andy128k.dev Git - ipf.git/commitdiff
reduce amount of jquery calls
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 30 Dec 2017 17:13:56 +0000 (18:13 +0100)
committerAndrey Kutejko <andy128k@gmail.com>
Mon, 16 Apr 2018 08:06:00 +0000 (10:06 +0200)
ipf/admin/assets/js/admin.js

index 7afafd5b2b4c549d6e06e7fdb01817d593e5b1c9..1a478a7f45224b171f46fe5855e54972cbc26493 100644 (file)
@@ -51,8 +51,8 @@ $(function(){
         });
     }
 
-    $('.admincheckgroup').each(function(){
-        var group = $(this);
+    function initCheckGroup(element) {
+        var group = $(element);
         group.find('.object-tools .checkall').click(function(){
             group.find('.checkgroup input').prop('checked', true);
             return false;
@@ -61,10 +61,11 @@ $(function(){
             group.find('.checkgroup input').prop('checked', false);
             return false;
         });
-    });
+    }
 
     initWidget('.dateinput', initDatePicker.bind(null, 'Y-m-d'));
     initWidget('.datetimeinput', initDatePicker.bind(null, 'Y-m-d H-i-s'));
+    initWidget('.admincheckgroup', initCheckGroup);
 
     // html
     function ipf_filebrowser(filebrowser_url, field_name, url, type, win) {