From 44b01ac5c0e349e952fe9c2ff3e2f14d82c55d0d Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 23 May 2016 15:20:44 +0200 Subject: [PATCH] Add back select all to majority of pages. --- www/themes/Gentele/templates/browse.tpl | 2 +- www/themes/Gentele/templates/cart.tpl | 4 +- www/themes/Gentele/templates/viewanime.tpl | 2 +- .../Gentele/templates/viewmoviefull.tpl | 2 +- www/themes/Gentele/templates/viewseries.tpl | 2 +- www/themes/Gentele/templates/viewxxxfull.tpl | 2 +- www/themes/shared/js/custom.js | 41 ++++++++++++++----- 7 files changed, 36 insertions(+), 19 deletions(-) diff --git a/www/themes/Gentele/templates/browse.tpl b/www/themes/Gentele/templates/browse.tpl index b7d1dbfed..8fc81a51f 100755 --- a/www/themes/Gentele/templates/browse.tpl +++ b/www/themes/Gentele/templates/browse.tpl @@ -75,7 +75,7 @@ - +
Select Select All Name diff --git a/www/themes/Gentele/templates/cart.tpl b/www/themes/Gentele/templates/cart.tpl index 491c2a1aa..a76aafcb2 100755 --- a/www/themes/Gentele/templates/cart.tpl +++ b/www/themes/Gentele/templates/cart.tpl @@ -33,9 +33,7 @@ - + diff --git a/www/themes/Gentele/templates/viewanime.tpl b/www/themes/Gentele/templates/viewanime.tpl index 71c125927..9a31a31ca 100755 --- a/www/themes/Gentele/templates/viewanime.tpl +++ b/www/themes/Gentele/templates/viewanime.tpl @@ -89,7 +89,7 @@
- Select - Select All Name Added Action
- + diff --git a/www/themes/Gentele/templates/viewmoviefull.tpl b/www/themes/Gentele/templates/viewmoviefull.tpl index 6b90ebe06..a0ee459f7 100755 --- a/www/themes/Gentele/templates/viewmoviefull.tpl +++ b/www/themes/Gentele/templates/viewmoviefull.tpl @@ -99,7 +99,7 @@
Select Select All Name Category Posted
- + - + diff --git a/www/themes/Gentele/templates/viewxxxfull.tpl b/www/themes/Gentele/templates/viewxxxfull.tpl index 42ef0ddba..a7ca2a25e 100755 --- a/www/themes/Gentele/templates/viewxxxfull.tpl +++ b/www/themes/Gentele/templates/viewxxxfull.tpl @@ -93,7 +93,7 @@
Select Select All Name
diff --git a/www/themes/Gentele/templates/viewseries.tpl b/www/themes/Gentele/templates/viewseries.tpl index d20ad3ae2..8c8206acb 100755 --- a/www/themes/Gentele/templates/viewseries.tpl +++ b/www/themes/Gentele/templates/viewseries.tpl @@ -154,7 +154,7 @@
Ep NameSelect Select All Category Posted Size
- +
Select All Name
diff --git a/www/themes/shared/js/custom.js b/www/themes/shared/js/custom.js index fc373308a..cf5bf6d67 100755 --- a/www/themes/shared/js/custom.js +++ b/www/themes/shared/js/custom.js @@ -1,4 +1,4 @@ -/* +/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. @@ -12,7 +12,7 @@ $(function () { $('#sidebar-menu li').on('click touchstart', function() { var link = $('a', this).attr('href'); - if(link) { + if(link) { window.location.href = link; } else { if ($(this).is('.active')) { @@ -21,7 +21,7 @@ $(function () { } else { $('#sidebar-menu li').removeClass('active'); $('#sidebar-menu li ul').slideUp(); - + $(this).addClass('active'); $('ul', this).slideDown(); } @@ -109,14 +109,33 @@ $('.collapse-link').click(function () { }); /** ****** /collapse panel *********************** **/ /** ****** iswitch *********************** **/ -if ($("input.flat")[0]) { - $(document).ready(function () { - $('input.flat').iCheck({ - checkboxClass: 'icheckbox_flat-green', - radioClass: 'iradio_flat-green' - }); + +$(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) @@ -332,4 +351,4 @@ if (typeof NProgress != 'undefined') { NProgress.done(); }); } -/** ****** NProgress *********************** **/ \ No newline at end of file +/** ****** NProgress *********************** **/