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

Ao adicionar tiles "Carrossel" e "Carrossel Multimídia" numa mesma capa, dá conflito no objeto "Galleria" #168

Open
idgserpro opened this issue Apr 4, 2017 · 1 comment

Comments

@idgserpro
Copy link
Member

Tile Carrossel apenas:

selecao_009

Tile Carrossel Multimídia apenas:

selecao_010

Tile Carrossel e Carrossel Multimídia:

selecao_011

Traceback:

Uncaught TypeError: Cannot read property 'top' of null
    at Galleria.<anonymous> (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++brasil.gov.tiles/tiles.js:426:99)
    at HTMLDivElement.<anonymous> (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++collective.galleria.js:4120:23)
    at HTMLDivElement.dispatch (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:4816)
    at HTMLDivElement.i (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:709)
    at Object.trigger (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:3422)
    at HTMLDivElement.<anonymous> (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:11098)
    at Function.each (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:2:11776)
    at init.each (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:2:8304)
    at init.trigger (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:11074)
    at Galleria.trigger (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++collective.galleria.js:3789:31)

Uncaught TypeError: Cannot read property 'top' of null
    at Galleria.<anonymous> (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++brasil.gov.tiles/tiles.js:398:99)
    at HTMLDivElement.<anonymous> (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++collective.galleria.js:4120:23)
    at HTMLDivElement.dispatch (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:4816)
    at HTMLDivElement.i (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:709)
    at Object.trigger (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:3422)
    at HTMLDivElement.<anonymous> (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:11098)
    at Function.each (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:2:11776)
    at init.each (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:2:8304)
    at init.trigger (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++plone.app.jquery.js:3:11074)
    at Galleria.trigger (http://idg:9877/Plone/portal_javascripts/Sunburst%20Theme/++resource++collective.galleria.js:3789:31)

Referências no código:

Onde ocorre o erro no browser:

var bottomThumbs = $('.galleria-thumbnails-container', mediacarousel).offset().top +

Onde o mediacarousel instancia o objeto do carrossel:

$('#mediacarousel-gallerie-%s').mediacarousel();

Onde o carrossel (do cover) instancia o objeto do carrossel: https://github.com/collective/collective.cover/blob/e23fed6b55222c54e5f16cb8631a74faddf56616/src/collective/cover/tiles/carousel.py#L22

Testado no release 1.1.5.2 do IDG. @rodfersou, faz muito tempo que você mexeu, mas se tiver alguma idéia, fique à vontade. var mediacarousel = '#'+this._target.id; em Galleria.on('loadfinish' em

var bottomThumbs = $('.galleria-thumbnails-container', mediacarousel).offset().top +
é executado duas vezes, uma hora tendo a variável mediacarousel de valor # e outra com #mediacarousel-gallerie-c18bb5038de84eceb9a5dc7b99b9931b', por isso tentar obter .top do elemento retorna null na primeira tentativa.

@idgserpro idgserpro added the bug label Apr 4, 2017
@hvelarde hvelarde added the 1.x label Aug 30, 2018
@hvelarde
Copy link
Member

esse problema ainda acontece?

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

No branches or pull requests

2 participants