From 5e6a62f69ae1a77d30eaa81f80af71893cd3fe0a Mon Sep 17 00:00:00 2001 From: jjwann Date: Fri, 31 Mar 2017 23:38:19 -0400 Subject: [PATCH 1/3] Can modify options after initialization and invoking countdown method --- src/countdown.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/countdown.js b/src/countdown.js index c5d491a..56e4ce7 100644 --- a/src/countdown.js +++ b/src/countdown.js @@ -284,7 +284,14 @@ instance.setFinalDate.call(instance, method); // Allow plugin to restart after finished // Fix issue #38 (thanks to @yaoazhen) - instance.start(); + if (argumentsArray[1]) { + $.extend(instance.options, argumentsArray[1]) + if (instance.options.defer === false) + instance.start(); + } + else { + instance.start(); + } } else { $.error('Method %s does not exist on jQuery.countdown' .replace(/\%s/gi, method)); From 709e530f0044d65f95587da7cd60cbea9385d6ae Mon Sep 17 00:00:00 2001 From: jjwann Date: Thu, 6 Apr 2017 22:41:46 -0400 Subject: [PATCH 2/3] Fixed semicolon error --- src/countdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/countdown.js b/src/countdown.js index 56e4ce7..ff1f4f9 100644 --- a/src/countdown.js +++ b/src/countdown.js @@ -285,7 +285,7 @@ // Allow plugin to restart after finished // Fix issue #38 (thanks to @yaoazhen) if (argumentsArray[1]) { - $.extend(instance.options, argumentsArray[1]) + $.extend(instance.options, argumentsArray[1]); if (instance.options.defer === false) instance.start(); } From 31e1ffe6a247ec9f32a3ea816673ba6149e2f0cf Mon Sep 17 00:00:00 2001 From: jjwann Date: Thu, 6 Apr 2017 22:45:24 -0400 Subject: [PATCH 3/3] Fixed bracket error --- src/countdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/countdown.js b/src/countdown.js index ff1f4f9..9186546 100644 --- a/src/countdown.js +++ b/src/countdown.js @@ -286,8 +286,9 @@ // Fix issue #38 (thanks to @yaoazhen) if (argumentsArray[1]) { $.extend(instance.options, argumentsArray[1]); - if (instance.options.defer === false) + if (instance.options.defer === false) { instance.start(); + } } else { instance.start();