Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidden property not working #89

Open
Zurd opened this issue Mar 2, 2019 · 3 comments
Open

hidden property not working #89

Zurd opened this issue Mar 2, 2019 · 3 comments

Comments

@Zurd
Copy link

Zurd commented Mar 2, 2019

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.

@walmik
Copy link
Owner

walmik commented Mar 3, 2019

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

@Zurd
Copy link
Author

Zurd commented Mar 5, 2019

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.

@walmik
Copy link
Owner

walmik commented Mar 5, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants