From 585dcf400ceb948b805bccdbd77b7a48135e5380 Mon Sep 17 00:00:00 2001 From: cottayson Date: Tue, 1 Mar 2016 12:05:29 +0600 Subject: [PATCH 1/3] Update jquery.checkboxes.js --- src/jquery.checkboxes.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/jquery.checkboxes.js b/src/jquery.checkboxes.js index ce7026d..4cff3c1 100644 --- a/src/jquery.checkboxes.js +++ b/src/jquery.checkboxes.js @@ -14,6 +14,17 @@ var Checkboxes = function (context) { this.$context = context; }; + + /** + * Random check all checkboxes in context. New!!! By cottayson + */ + Checkboxes.prototype.randomcheck = function () { + this.$context.find(':checkbox') + .filter(':not(:disabled)') + .each(function () { + $(this).prop( 'checked', parseInt(2*Math.random()) ); + }); + }; /** * Check all checkboxes in context. From ea4b0157df7264188108314a62c0ff36db97530a Mon Sep 17 00:00:00 2001 From: cottayson Date: Tue, 1 Mar 2016 12:16:11 +0600 Subject: [PATCH 2/3] Update bower.json --- bower.json | 1 + 1 file changed, 1 insertion(+) diff --git a/bower.json b/bower.json index b7c7245..442ed4c 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,7 @@ "checkboxes", "jquery", "plugin", + "randomcheck", "check", "uncheck", "range", From 1265e58fbe597888328ec1b46aa925993dc5f35f Mon Sep 17 00:00:00 2001 From: cottayson Date: Tue, 1 Mar 2016 12:19:39 +0600 Subject: [PATCH 3/3] Update test.html true test --- tests/test.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test.html b/tests/test.html index 54caee6..5b38099 100644 --- a/tests/test.html +++ b/tests/test.html @@ -44,9 +44,12 @@ Check all - Uncheck all + Check random