From de188547779955f53f9acd6b64bbe9517b19f63c Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 30 Dec 2017 18:13:56 +0100 Subject: [PATCH] reduce amount of jquery calls --- ipf/admin/assets/js/admin.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipf/admin/assets/js/admin.js b/ipf/admin/assets/js/admin.js index 7afafd5..1a478a7 100644 --- a/ipf/admin/assets/js/admin.js +++ b/ipf/admin/assets/js/admin.js @@ -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) { -- 2.49.0