Page 1 of 1

2 articles with AG in the same page: no pictures displayed!

Posted: Tue Dec 10, 2013 8:57 pm
by Immortal
Hi!
I'm trying to use AG for my website but I have several issues.
The main issue is this:
I have a page (menu item type: article->category blog) in witch I would put X articles, all with the same basic template (the galleries in the articles will have the same template too).
If I put only one article, the page is "fine" (it cuts all the left and the bottom borders, but I think this is another issue related to the template) as you can see there: link
If I put two articles (link) the page has some "strange" layout and no more picture displayed.
Moreover the popup engine doesn't work (if I click on any picture there is no popup).

Can you help me to solve this?

ps. I have the same problem also with the default template.

Re: 2 articles with AG in the same page: no pictures display

Posted: Mon Dec 16, 2013 10:15 am
by Vasiljevski
I have some strange behavior, when I open second link (one that should have more galleries).
Firefox CPU load jumps to 100% and I cannot do anything.
In Chrome I managed to see this:

Code: Select all

Uncaught RangeError: Maximum call stack size exceeded jquery.galleryview-2.1.1.js:1
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
150
Uncaught RangeError: Maximum call stack size exceeded jquery.galleryview-2.1.1.js:1
62
Uncaught RangeError: Maximum call stack size exceeded jquery.galleryview-2.1.1.js:1
Uncaught RangeError: Maximum call stack size exceeded jquery.galleryview-2.1.1.js:1
20
Uncaught RangeError: Maximum call stack size exceeded 
I'm not sure what is the cause for this error, but it seems to be stuck in the infinite loop in this part of code:

Code: Select all

	/*
	**	getPos(jQuery element
	**		Calculate position of an element relative to top/left corner of gallery
	**		If the gallery bounding box itself is passed to the function, calculate position of gallery relative to top/left corner of browser window
	** 		RETURNS - JSON {left: int, top: int}
	*/
		function getPos(el) {
			var left = 0, top = 0;
			var el_id = el.id;
			if(el.offsetParent) {
				do {
					left += el.offsetLeft;
					top += el.offsetTop;
				} while(el = el.offsetParent);
			}
			//If we want the position of the gallery itself, return it
			if(el_id == id) {return {'left':left,'top':top};}
			//Otherwise, get position of element relative to gallery
			else {
				var gPos = getPos(j_gallery[0]);
				var gLeft = gPos.left;
				var gTop = gPos.top;
				
				return {'left':left-gLeft,'top':top-gTop};
			}
		};
inplugins/content/admirorgallery/admirorgallery/templates/galleryView/jquery.galleryview-2.1.1.js

In the past we had problems with more GalleryView template on the same page, but it turned out it was ID problem, that prevented the gallery for properly generating. But this is new to me.

Re: 2 articles with AG in the same page: no pictures display

Posted: Mon Dec 16, 2013 10:16 am
by Vasiljevski
What happens if you use classic instead of GalleryView? Can you change and let me check?

Re: 2 articles with AG in the same page: no pictures display

Posted: Mon Dec 16, 2013 6:54 pm
by Immortal
Vasiljevski wrote:What happens if you use classic instead of GalleryView? Can you change and let me check?
check yourself. It seems ok! :o
And now, also the popup function works!

Re: 2 articles with AG in the same page: no pictures display

Posted: Thu Dec 19, 2013 11:32 am
by Vasiljevski
Probably some JavaScript file causes GalleryView to break. It goes into infinite loop and everything is lost :)

You can further check the cause of this by debugging JS files you include on your page, or use classic template :)