diff --git a/Changelog b/Changelog index a71a8e168..d417cc832 100755 --- a/Changelog +++ b/Changelog @@ -1,5 +1,3 @@ -2016-05-25 DariusIII - * Chg: Move icheck from custom.js to functions.js 2016-05-24 DariusIII * Chg: Rename groupid column to groups_id. * Upd: Improve speed of update_releases on larger databases diff --git a/www/themes/shared/js/custom.js b/www/themes/shared/js/custom.js index 3b7154366..cf5bf6d67 100755 --- a/www/themes/shared/js/custom.js +++ b/www/themes/shared/js/custom.js @@ -108,6 +108,35 @@ $('.collapse-link').click(function () { }, 50); }); /** ****** /collapse panel *********************** **/ +/** ****** iswitch *********************** **/ + +$(function () { + var checkAll = $('input.flat-all'); + var checkboxes = $('input.flat'); + + $('input').iCheck({ + checkboxClass: 'icheckbox_flat-green', + radioClass: 'iradio_flat-green' + }); + + checkAll.on('ifChecked ifUnchecked', function(event) { + if (event.type == 'ifChecked') { + checkboxes.iCheck('check'); + } else { + checkboxes.iCheck('uncheck'); + } + }); + + checkboxes.on('ifChanged', function(event){ + if(checkboxes.filter(':checked').length == checkboxes.length) { + checkAll.prop('checked', 'checked'); + } else { + checkAll.prop('checked', false); + } + checkAll.iCheck('update'); + }); +}); +/** ****** /iswitch *********************** **/ /** ****** star rating *********************** **/ // Starrr plugin (https://github.com/dobtco/starrr) var __slice = [].slice; diff --git a/www/themes/shared/js/functions.js b/www/themes/shared/js/functions.js index 85db81a64..dbf5784a2 100755 --- a/www/themes/shared/js/functions.js +++ b/www/themes/shared/js/functions.js @@ -1210,33 +1210,3 @@ function getHistory() timeout:5000 }); } - -/** ****** iswitch *********************** **/ - -$(function () { - var checkAll = $('input.flat-all'); - var checkboxes = $('input.flat'); - - $('input').iCheck({ - checkboxClass: 'icheckbox_flat-green', - radioClass: 'iradio_flat-green' - }); - - checkAll.on('ifChecked ifUnchecked', function(event) { - if (event.type == 'ifChecked') { - checkboxes.iCheck('check'); - } else { - checkboxes.iCheck('uncheck'); - } - }); - - checkboxes.on('ifChanged', function(event){ - if(checkboxes.filter(':checked').length == checkboxes.length) { - checkAll.prop('checked', 'checked'); - } else { - checkAll.prop('checked', false); - } - checkAll.iCheck('update'); - }); -}); -/** ****** /iswitch *********************** **/