timer.jquery icon indicating copy to clipboard operation
timer.jquery copied to clipboard

hidden property not working

Open Zurd opened this issue 5 years ago • 3 comments

The documentation clearly state that there should be a hidden property:

$("#div-id").timer({
	seconds:	{Int},		// The number of seconds to start the timer from
	duration: 	{String},	// The time to countdown from. `seconds` and `duration` are mutually exclusive
	callback: 	{Function},	// If duration is set, this function is called after `duration` has elapsed
	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.
});

But in the code, there's nothing about it:

function getDefaultConfig() {
	return {
		seconds: 0,					// Default seconds value to start timer from
		editable: false,			// Allow making changes to the time by clicking on it
		duration: null,				// Duration to run callback after
		callback: function() {		// Default callback to run after elapsed duration
			console.log('Time up!');
		},
		repeat: false,				// This will repeat callback every n times duration is elapsed
		countdown: false,			// If true, this will render the timer as a countdown (must have duration)
		format: null,				// This sets the format in which the time will be printed
		updateFrequency: 500		// How often should timer display update
	};
}

Also there's a few typos in the documentation, missing a comma and replacing ; by :, so it should be:

	editable:	{Bool},		// If click and edit time is enabled
	hidden:		{Bool}		// If true, the timer is not displayed in the selected item.

Zurd avatar Mar 02 '19 23:03 Zurd

Hi @Zurd do you have some code snippet where it didnt work? As for code point of view, here s the LOC where hidden is implemented: https://github.com/walmik/timer.jquery/blob/master/src/Timer.js#L62

walmik avatar Mar 03 '19 02:03 walmik

Hi, simply the code $("#gameTime").timer({ hidden:true }); does not work, I can still see the timer on the webpage in the div with the id gameTime.

I see that the hidden property is indeed coded in https://github.com/walmik/timer.jquery/blob/master/src/Timer.js#L62

But the src folder has 4 js files. Why not have all of them in one file? How can you include just one js file instead of 4?

Note that, in the README file, it points to https://cdnjs.cloudflare.com/ajax/libs/timer.jquery/0.7.0/timer.jquery.js and the hidden word is not found there.

I've also tried the min version with obfuscated code and the hidden property does not work: https://raw.githubusercontent.com/walmik/timer.jquery/master/dist/timer.jquery.min.js

And on https://jquerytimer.com/, the last link at the bottom points to a 404 page.

Zurd avatar Mar 05 '19 03:03 Zurd

Thank you for reporting all of this, I ll take a look at it once I get some time (kinda busy this month).

@Psychosynthesis do you think you can take a look at this issue?

walmik avatar Mar 05 '19 13:03 walmik