mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
* Change in files * Renamin files and folders * cleaning up a single piece of lint * Removing boat picture from docs * add superset word mark * Update rename note in docs * Fixing images * Pinning datatables * Fixing issues with mapbox-gl * Forgot to rename one file * Linting * v0.13.0 * adding pyyaml to dev-reqs
26 lines
651 B
JavaScript
26 lines
651 B
JavaScript
const $ = require('jquery');
|
|
|
|
function iframeWidget(slice) {
|
|
function refresh() {
|
|
$('#code').attr('rows', '15');
|
|
$.getJSON(slice.jsonEndpoint(), function (payload) {
|
|
const url = slice.render_template(payload.form_data.url);
|
|
slice.container.html('<iframe style="width:100%;"></iframe>');
|
|
const iframe = slice.container.find('iframe');
|
|
iframe.css('height', slice.height());
|
|
iframe.attr('src', url);
|
|
slice.done(payload);
|
|
})
|
|
.fail(function (xhr) {
|
|
slice.error(xhr.responseText, xhr);
|
|
});
|
|
}
|
|
|
|
return {
|
|
render: refresh,
|
|
resize: refresh,
|
|
};
|
|
}
|
|
|
|
module.exports = iframeWidget;
|