Skip to content

Commit

Permalink
Fixing a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 19, 2016
1 parent 5f9f95b commit 5f88068
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion panoramix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def url(self):

@property
def metadata_dejson(self):
return json.loads(self.json_metadata)
if self.json_metadata:
return json.loads(self.json_metadata)
else:
return {}

def dashboard_link(self):
return '<a href="{self.url}">{self.dashboard_title}</a>'.format(self=self)
Expand Down
6 changes: 4 additions & 2 deletions panoramix/static/widgets/viz_iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ px.registerViz('iframe', function(slice) {
$('#code').attr('rows', '15')
$.getJSON(slice.jsonEndpoint(), function(payload) {
slice.container.html(
'<iframe style="width:100%; height:100%;"></iframe>');
'<iframe style="width:100%;"></iframe>');
console.log(slice);
slice.container.find('iframe').attr('src', payload.form_data.url);
iframe = slice.container.find('iframe');
iframe.css('height', slice.height());
iframe.attr('src', payload.form_data.url);
slice.done();
})
.fail(function(xhr) {
Expand Down

0 comments on commit 5f88068

Please sign in to comment.