Files
superset2/panoramix/static/widgets/viz_iframe.js
Maxime Beauchemin 5f880682c0 Fixing a bug
2016-01-19 12:58:44 -08:00

23 lines
600 B
JavaScript

px.registerViz('iframe', function(slice) {
function refresh() {
$('#code').attr('rows', '15')
$.getJSON(slice.jsonEndpoint(), function(payload) {
slice.container.html(
'<iframe style="width:100%;"></iframe>');
console.log(slice);
iframe = slice.container.find('iframe');
iframe.css('height', slice.height());
iframe.attr('src', payload.form_data.url);
slice.done();
})
.fail(function(xhr) {
slice.error(xhr.responseText);
});
};
return {
render: refresh,
resize: refresh,
};
});