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

Galleria.js Uncaught TypeError: Cannot read property 'left' of undefined on empty image list #1924

Closed
jlerbsc opened this issue Nov 24, 2016 · 7 comments
Labels
6.0.9 🐞 defect Bug...Something isn't working
Milestone

Comments

@jlerbsc
Copy link

jlerbsc commented Nov 24, 2016

IMPORTANT

  • If you open a issue, fill every item. Otherwise the issue might be closed as invalid.
  • Before you open a issue, test it with the current/newest version.

1) Environment

  • PrimeFaces version: 5.3
  • Does it work on the newest PrimeFaces version? I don't know
  • Application server + version: Tomcat8
  • Affected browsers: Chrome 54.0

2) Expected behavior

No javascript error in JS console.

3) Actual behavior

When a galleria component contains no image, there is a Uncaught TypeError: Cannot read property 'left' of undefined
at c.select (/javax.faces.resource/galleria/galleria.js?ln=primefaces&v=5.3:1:3826)
at c.next (/javax.faces.resource/galleria/galleria.js?ln=primefaces&v=5.3:1:4580) in the navigator console
..

4) Steps to reproduce

Use showcase

5) Sample XHTML

..

6) Sample bean

Replace images list to empty list

@ManagedBean
public class ImagesView {

private List<String> images;

@PostConstruct
public void init() {
	//		this.images = new ArrayList<String>();
	//		for (int i = 1; i <= 2; i++) {
	//			this.images.add("nature" + i + ".jpg");
	//		}
	this.images = Collections.EMPTY_LIST;
}

public List<String> getImages() {
	return this.images;
}

}

..

@jlerbsc jlerbsc changed the title Galleria.js Uncaught TypeError: Cannot read property 'left' of undefined Galleria.js Uncaught TypeError: Cannot read property 'left' of undefined on empty image list Nov 25, 2016
@mertsincan mertsincan added 6.0.9 🐞 defect Bug...Something isn't working labels Nov 25, 2016
@mertsincan mertsincan added this to the 6.1 milestone Nov 25, 2016
mertsincan added a commit that referenced this issue Nov 25, 2016
This reverts commit 85dea11063337238abcc647017f9285a1598c461.
mertsincan added a commit that referenced this issue Nov 25, 2016
@jlerbsc
Copy link
Author

jlerbsc commented Nov 25, 2016

Could you fix it in version 5.3 please?

@mertsincan
Copy link
Member

I can add it into 5.3.x version. (Next version -> 5.3.18)

@jlerbsc
Copy link
Author

jlerbsc commented Nov 25, 2016

Ok Thanks. Can i download it through maven repository?

@tandraschko
Copy link
Member

Elite versions are not available via maven and you need to purchase elite access.

@mertsincan
Copy link
Member

Too fast :) Thomas 👍

@jlerbsc
Copy link
Author

jlerbsc commented Nov 25, 2016

Ok I will wait for the update 5.3.18

@kukel
Copy link
Contributor

kukel commented Nov 25, 2016

You can always apply the patch yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.0.9 🐞 defect Bug...Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants