From 7328951224acfe60ceb60898d5d8d2ce5fe8cc7f Mon Sep 17 00:00:00 2001 From: Nick <32971513+Psychosynthesis@users.noreply.github.com> Date: Tue, 16 Oct 2018 19:31:45 +0300 Subject: [PATCH 1/2] Adding new parameter --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 93f2117..864df77 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ $("#div-id").timer({ repeat: {Bool}, // If duration is set, `callback` will be called repeatedly format: {String}, // Format to show time in editable: {Bool} // If click and edit time is enabled + hidden; {Bool} // If true, the timer is not displayed in the selected item. }); ``` From 78f1be5fa0691349cadb975f4a8cce9fbc510b7d Mon Sep 17 00:00:00 2001 From: Nick <32971513+Psychosynthesis@users.noreply.github.com> Date: Tue, 16 Oct 2018 19:32:33 +0300 Subject: [PATCH 2/2] Adding new parameter --- src/Timer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Timer.js b/src/Timer.js index 5119ace..bf31aa3 100644 --- a/src/Timer.js +++ b/src/Timer.js @@ -59,7 +59,9 @@ function Timer(element, config) { Timer.prototype.start = function() { if (this.state !== Constants.TIMER_RUNNING) { utils.setState(this, Constants.TIMER_RUNNING); - this.render(); + if (this.config.hidden !== true) { + this.render(); + } this.intervalId = setInterval(utils.intervalHandler.bind(null, this), this.config.updateFrequency); } };