Is it a problem with code or a free version limitation?

GieMik

New member
Hello,

First of all, impressive viewer ;) . I'm trying to integrate your viewer in a project (using YII2 framework) and I got a problem.

I'm placing viewers in a modal, which appears when a button is pressed (There are more buttons which should open a different product viewer ). It triggers this kind of code inside a modal.

$('.model-image-link').click(function() {
$('#modeling-modal').modal('show');
$('#wr360PlayerId').rotator({
configFileURL : 'pictures/3d-models/360_assets/' + id + '/' + id +'.xml',
graphicsPath : 'imagerotator/html/img/basic',
zIndexLayersOn : true,
responsiveBaseWidth : 0
});
});

Everything works fine, it loads a product for viewing, but after closing a modal it doesn't load any viewers (this one is also gone). So, I'm not sure where is the problem, is it a limitation (of free software) or there's something wrong with a code. Waiting for your reply. ;)
 

WebSupport

Active member
Hi and thanks for the kind words! :)

Interesting. Where can we download the modal plugin you are using so we could give it a try and see what's going on?

PS: the free version shouldn't affect this..
 

WebSupport

Active member
Checked this today and here's what's happening:

1. .modeling-modal is not removed from DOM upon modal close (it remains hidden), which is fine.
2. #wr360PlayerId also remains hidden when you click close on the popup.
3. when you click the 360 viewer link again, this hidden modal is brought up but you also attach the viewer to the same container (#wr360PlayerId) that has been already initialized and loaded.

We don't track this scenario unfortunately, so a simple fix is to either remove #wr360PlayerId from DOM upon modal close or on re-open and then append a new element for the viewer when user activates the modal again (and do the rotator thing again).

Or you can track that the modal has been opened once and then just don't create rotator instance again for the same thumbnail as it's already loaded. You can also use our API, and for every other thumbnail that will have a 3D product view, just call our reload(..) API call with updated xml path (and don't create more rotator instances after the first one if you plan to use the same modal container for all views).

I hope it helps! Just let us know if any questions.
 
Top