From e45155efadb1bdfe82bcf82b28fd3eb6c25f7648 Mon Sep 17 00:00:00 2001 From: ChanMyeong Date: Mon, 24 Sep 2012 05:10:46 +0000 Subject: [PATCH] Issue 2443. checkbox 'check all' JS function added. git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11458 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/admin/tpl/js/admin.js | 11 +++++++++++ modules/admin/tpl/js/admin.min.js | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 5a7fc0233..8d4d1a850 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -105,4 +105,15 @@ jQuery(function($){ } multilingual(); $('.multilingual').change(multilingual); +// Check All + $('th>input[type="checkbox"]').change(function(){ + var $this =$(this); + var $target = $this.closest('table').find('th>input[type="checkbox"], td>input[type="checkbox"]'); + if($this.is(':checked')){ + $target.attr('checked','checked'); + } else { + $target.removeAttr('checked'); + } + + }); }); \ No newline at end of file diff --git a/modules/admin/tpl/js/admin.min.js b/modules/admin/tpl/js/admin.min.js index 5a7fc0233..8d4d1a850 100644 --- a/modules/admin/tpl/js/admin.min.js +++ b/modules/admin/tpl/js/admin.min.js @@ -105,4 +105,15 @@ jQuery(function($){ } multilingual(); $('.multilingual').change(multilingual); +// Check All + $('th>input[type="checkbox"]').change(function(){ + var $this =$(this); + var $target = $this.closest('table').find('th>input[type="checkbox"], td>input[type="checkbox"]'); + if($this.is(':checked')){ + $target.attr('checked','checked'); + } else { + $target.removeAttr('checked'); + } + + }); }); \ No newline at end of file