App V1 modals created from side_bar: how to migrate?
bfcamara opened this issue · 1 comments
I am migrating a V1 app to V2 and I have some modals that are created from side_bar, which is where my app is hosted. This is the snippet typically used in V1
...
var $modal = this.$('.newWorkItemModal').modal();
$modal.find('.modal-body').html(this.renderTemplate('loading'));
...
This code runs in V1 perfectly well, since the modal and the app itself are using the same DOM and context of the main support app, right?
Now, If I try to run this code in V2, the modal content is loaded inside the side_bar which is now hosted in an iframe.
The V2 docs mention that the modal feature is implemented using the instances
api. In this case a new iframe will be created to host the modal content, which isn't the behavior that I want in my case, otherwise the migration becomes complex due the communication between modals and side_bar.
Any thoughts?
Thanks in advance
Hi Bruno,
I replied to your post here.
We have a demo app that demonstrates how to implement this in v2: https://github.com/zendesk/demo_apps/tree/master/v2/support/modal_sample_app
Hope this helps.