solved glDatePicker offset/position

SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
I'm having trouble with the datepicker (glDatePicker 1.3) position - it is way out on my skin.

I've found that if I change offset() to position() in the js (using an unminified version) the picker appears in the correct location on both my skin and jrElastic. (as suggested by this https://github.com/glad/glDatePicker/pull/9)

Any ideas as to how I can achieve the same thing without editing the glDatePicker js?

Thanks


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 08/03/14 12:27:10PM
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
This is the change I made, just changed offset to position in two places:
			// If calendar doesn't exist, make one
			if($("#"+calId).length == 0)
			{
				target.after
				(
					$("<div id='"+calId+"'></div>")
					.css(
					{
						"position":settings.position,
						"z-index":settings.zIndex,
						"left":(target.position().left), 
//changed from left":(target.offset().left),
						"top":target.position().top+target.outerHeight(true) 
//changed from "top":target.offset().top+target.outerHeight(true)
					})
				);
			}



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 07/01/14 06:27:42AM
michael
@michael
11 years ago
7,800 posts
who's 'gl'?

glDatePicker

GUESSES:
* Make sure that that calId starts with a letter, ids that start with a number cause problems.
* see how settings.position is set. That looks like the best candidate to start fiddling with.

What I think is happening:
* the position is determined by locating the position of something that already exists on the page, moving that around should change the position of the date picker to it.

Also look at position:relative and position:absolute. If you have a position:absolute INSIDE a position:relative, then it becomes absolute position in relation to the containing object, NOT to the page. So that could be effecting it.
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
I cant really ask gl, they use the current version of the plugin which doesnt have the same problems, and which has documentation available.

You can control this on the current version, and probably on the older version, but not how its used in jamroom.

Also, there doesnt seem to be any copyright notice on the minified plugin or anywhere else in the jr5 core. The unminified version (which you can find in the archive branch on github) does state that the notice is required, and it does make gl easier to find.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 07/02/14 01:06:36AM
michael
@michael
11 years ago
7,800 posts
huh? who is gl? why cant you ask them?

So the problem is jamroom is using an older version of some plugin that needs updating?

Maybe im not up-to-date enough with what the plugin is to try to help.

--edit--
found gl: https://github.com/glad/glDatePicker/

sorry I thought gl was their Jamroom developers prefix. oops.
updated by @michael: 07/02/14 01:22:40AM
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Quote: So the problem is jamroom is using an older version of some plugin that needs updating?
Not necessarily, I can't see any way of configuring the plugin within jamroom regardless of the version.

It isn't a problem, I've changed the 1.3 script to use position() and that works for my site.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
11 years ago
10,149 posts
I will check this out and get this updated to the latest version (if I can without breaking backwards compatibility).

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,149 posts
I've modified the JS for the next release to use position() - I'm not seeing any issues with it, and the new release of glDatePicker looks like a rewrite, so for now I'm going to stick with this small change until we have issues which would make us need the new one.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,584 posts
Thanks Brian!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

Tags