superset/caravel/assets/visualizations/markup.js

23 lines
478 B
JavaScript
Raw Normal View History

2016-03-18 02:44:58 -04:00
var $ = window.$ || require('jquery');
2016-06-26 16:12:52 -04:00
require('./markup.css');
2016-03-18 02:44:58 -04:00
function markupWidget(slice) {
function refresh() {
$('#code').attr('rows', '15');
$.getJSON(slice.jsonEndpoint(), function (payload) {
slice.container.html(payload.data.html);
slice.done(payload);
2016-03-18 02:44:58 -04:00
})
.fail(function (xhr) {
slice.error(xhr.responseText, xhr);
2016-03-18 02:44:58 -04:00
});
}
return {
render: refresh,
resize: refresh,
2016-03-18 02:44:58 -04:00
};
}
module.exports = markupWidget;