Skip to content

Commit

Permalink
Merge branch 'dataviewer-iframe' of github.com:okfn/ckan into datavie…
Browse files Browse the repository at this point in the history
…wer-iframe
  • Loading branch information
tobes committed Sep 24, 2012
2 parents 39e2380 + 8b69e00 commit bc19505
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 35 deletions.
21 changes: 0 additions & 21 deletions ckan/public/base/datapreview/css/recline.css
Expand Up @@ -53,24 +53,3 @@ body {
.header .recline-query-editor .input-prepend {
vertical-align: top;
}

#ckanext-datapreview {
position: relative;
overflow: auto;
}

#ckanext-datapreview iframe {
min-height: 480px;
border: 1px solid #ccc;
padding: 7px;
}

.ckanext-datapreview-iframe {
width: 100%;
}

img.ckanext-datapreview-direct-embed {
max-height: 500px;
max-width: 100%;
overflow: hidden;
}
4 changes: 2 additions & 2 deletions ckan/public/base/javascript/modules/data-viewer.js
Expand Up @@ -29,9 +29,9 @@ this.ckan.module('data-viewer', function (jQuery) {
MIN_HEIGHT = 300;

resizeTimer = setTimeout(function() {
var height = that.el.contents().find('body').outerHeight();
var height = that.el.contents().find('body').get(0).scrollHeight;
height = Math.max(height, MIN_HEIGHT);
var deltaHeight = height - that.el.outerHeight();
var deltaHeight = height - that.el.get(0).scrollHeight;
if (deltaHeight > 0 || deltaHeight < -10) {
that.el.animate({height: height+20}, Math.min(700, height*2));
}
Expand Down
9 changes: 0 additions & 9 deletions ckan/public/base/javascript/modules/dismiss-alert.js

This file was deleted.

4 changes: 2 additions & 2 deletions ckan/templates/dataviewer/snippets/data_preview.html
@@ -1,9 +1,9 @@
<div class="module-content">
<div class="module-content" class="ckanext-datapreview">
{% if embed %}
{# images can be embedded directly #}
<img class="ckanext-datapreview-direct-embed" src="{{ resource_url }}"></img>
{% else %}
<iframe src="{{ resource_url }}" class="ckanext-datapreview-iframe" frameborder="0" scrolling="auto" width="100%" data-module="data-viewer">
<iframe src="{{ resource_url }}" frameborder="0" width="100%" data-module="data-viewer">
<p>{{ _('Your browser does not support iframes.') }}</p>
</iframe>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/dataviewer/snippets/no_preview.html
@@ -1,5 +1,5 @@
<div class="module-content">
<div class="alert alert-block" data-module="dismiss-alert">
<div class="alert alert-block fade in">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>{{ _('This resource cannot be previewed.') }}</h4>
{% set t = '<code>'|safe + resource_type + '</code>'|safe %}
Expand Down

0 comments on commit bc19505

Please sign in to comment.