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:
@@ -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;
|
||||
};
|
||||
|
@@ -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>
|
||||
|
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user