mirror of
https://github.com/apache/superset.git
synced 2026-04-12 04:37:49 +00:00
[panoramix] -> [dashed]
This commit is contained in:
25
dashed/assets/visualizations/iframe.js
Normal file
25
dashed/assets/visualizations/iframe.js
Normal file
@@ -0,0 +1,25 @@
|
||||
var $ = window.$ || require('jquery');
|
||||
|
||||
function iframeWidget(slice) {
|
||||
|
||||
function refresh() {
|
||||
$('#code').attr('rows', '15');
|
||||
$.getJSON(slice.jsonEndpoint(), function (payload) {
|
||||
slice.container.html('<iframe style="width:100%;"></iframe>');
|
||||
var 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
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = iframeWidget;
|
||||
Reference in New Issue
Block a user