diff options
Diffstat (limited to 'admin/themes/default/js')
-rw-r--r-- | admin/themes/default/js/common.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/admin/themes/default/js/common.js b/admin/themes/default/js/common.js index 0f6435387..1f0594100 100644 --- a/admin/themes/default/js/common.js +++ b/admin/themes/default/js/common.js @@ -1,3 +1,21 @@ +jQuery.fn.fontCheckbox = function() { + this.find('input[type=checkbox], input[type=radio]').each(function() { + if (!jQuery(this).is(':checked')) { + jQuery(this).prev().toggleClass('icon-check icon-check-empty'); + } + }); + this.find('input[type=checkbox]').on('change', function() { + jQuery(this).prev().toggleClass('icon-check icon-check-empty'); + }); + this.find('input[type=radio]').on('change', function() { + jQuery(this).closest('.font-checkbox').find('input[type=radio][name='+ jQuery(this).attr('name') +']') + .prev().toggleClass('icon-check icon-check-empty'); + }); +}; + +// init fontChecbox everywhere +jQuery('.font-checkbox').fontCheckbox(); + function array_delete(arr, item) { var i = arr.indexOf(item); if (i != -1) arr.splice(i, 1); |