mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
Simplifying the viz interface (#2005)
This commit is contained in:
committed by
GitHub
parent
1c338ba742
commit
e46ba2b4a4
@@ -1,25 +1,12 @@
|
||||
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,
|
||||
};
|
||||
function iframeWidget(slice, payload) {
|
||||
$('#code').attr('rows', '15');
|
||||
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);
|
||||
}
|
||||
|
||||
module.exports = iframeWidget;
|
||||
|
||||
Reference in New Issue
Block a user