1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 00:00:00 +00:00

[spreadsheet file view] improvement

This commit is contained in:
llj
2015-09-11 16:12:08 +08:00
parent 0f5472bdee
commit f43a5bda7a
3 changed files with 11 additions and 13 deletions

View File

@@ -1,10 +1,8 @@
#spreadsheet-container iframe {
width: 950px;
background:#fff;
border:none;
border: 1px solid #ccc;
box-shadow: 0 0 6px #ccc;
margin: auto;
min-height: 500px;
max-height: 1000px;
overflow: auto;
};

View File

@@ -1,6 +1,3 @@
{% load i18n %}
<div id="convert-loading" class="alc">
<img src="{{ MEDIA_URL }}img/loading-icon.gif" alt="" class="vam" />
<span class="loading-text vam">{% trans "The file is being processed, please wait..." %}</span>
</div>
<img src="{{ MEDIA_URL }}img/loading-icon.gif" alt="{% trans "Loading..." %}" class="loading-tip" />
<div id="spreadsheet-container"></div>

View File

@@ -2,10 +2,13 @@
$(function() {
var commit_id = '{{ current_commit.id }}' || '{{ repo.head_cmmt_id }}';
function load_excel() {
$('#convert-loading').remove();
$('#file-view').css({'height': 'auto'}).find('.loading-tip').hide();
var iframe = document.createElement('iframe');
iframe.src = '{{ SITE_ROOT}}office-convert/static/{{ repo.id }}/' + commit_id + '{{ path|urlencode }}/index.html?token=' + '{{ shared_token }}';
$('#spreadsheet-container').append(iframe);
iframe.onload = function () {
this.height = this.contentDocument.body.scrollHeight;
};
}
function check_status () {
@@ -36,9 +39,9 @@ $(function() {
str = "{% trans "Failed. Please check the network." %}";
}
$('#file-view').html('<div id="file-view-tip"><p class="error">' + str + '</p></div>');
}
});
}
}
});
}
check_status();
check_status();
});