mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
Allowing for templated urls in iFrame (#460)
* Allowing for templated urls in iFrame
This can allow for passing {{ width }} and {{ height }} as dynamic
attributes in the iFrame's URL.
The new method Slice.render_template method could do more eventually
exposing more variables to be used in dynamic strings.
* Passing function references
* js linting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var $ = require('jquery');
|
||||
var jQuery = $;
|
||||
var d3 = require('d3');
|
||||
var Mustache = require('mustache');
|
||||
|
||||
// vis sources
|
||||
var sourceMap = {
|
||||
@@ -215,6 +216,13 @@ var px = (function () {
|
||||
getWidgetHeader: function () {
|
||||
return this.container.parents("li.widget").find(".chart-header");
|
||||
},
|
||||
render_template: function (s) {
|
||||
var context = {
|
||||
width: this.width,
|
||||
height: this.height
|
||||
};
|
||||
return Mustache.render(s, context);
|
||||
},
|
||||
jsonEndpoint: function () {
|
||||
var parser = document.createElement('a');
|
||||
parser.href = data.json_endpoint;
|
||||
|
||||
Reference in New Issue
Block a user