aboutsummaryrefslogtreecommitdiffstats
path: root/admin/themes/default/js/common.js
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-09-15 15:18:17 +0000
committermistic100 <mistic@piwigo.org>2014-09-15 15:18:17 +0000
commitb56c103188ab4fb76fdcc42c4fbc3810d384b5aa (patch)
tree3841699071be6ec8e40ea0a696a1e8fdfe3cd540 /admin/themes/default/js/common.js
parent34c0290bbfa62a6ef24f2f71cb2366863c56cb72 (diff)
use fontello for every checkbox on config screens + split configuration.tpl file
git-svn-id: http://piwigo.org/svn/trunk@29539 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes/default/js/common.js')
-rw-r--r--admin/themes/default/js/common.js18
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);