mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
[file view] added 'back to top'
This commit is contained in:
@@ -2597,7 +2597,7 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
position:fixed;
|
position:fixed;
|
||||||
right:0;
|
right:0;
|
||||||
}
|
}
|
||||||
#fileview-toolbar .item {
|
.fileview-toolbar .item {
|
||||||
width:59px;
|
width:59px;
|
||||||
height:40px;
|
height:40px;
|
||||||
padding-top:18px;
|
padding-top:18px;
|
||||||
@@ -2608,11 +2608,11 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
border-right:0;
|
border-right:0;
|
||||||
border-top:0;
|
border-top:0;
|
||||||
}
|
}
|
||||||
#fileview-toolbar .item:first-child {
|
.fileview-toolbar .item:first-child {
|
||||||
border-top:1px solid #c0c0c0;
|
border-top:1px solid #c0c0c0;
|
||||||
border-top-left-radius:3px;
|
border-top-left-radius:3px;
|
||||||
}
|
}
|
||||||
#fileview-toolbar .item:last-child {
|
.fileview-toolbar .item:last-child {
|
||||||
border-bottom-left-radius:3px;
|
border-bottom-left-radius:3px;
|
||||||
}
|
}
|
||||||
/* shareadmin & useradmin */
|
/* shareadmin & useradmin */
|
||||||
|
BIN
media/img/top.png
Normal file
BIN
media/img/top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 368 B |
@@ -9,6 +9,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/file_view_extra.css" />
|
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/file_view_extra.css" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#header, #footer { display:none; }
|
#header, #footer { display:none; }
|
||||||
|
#view-hd { margin-top: 4px; }
|
||||||
#star {
|
#star {
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
margin-left:3px;
|
margin-left:3px;
|
||||||
@@ -116,18 +117,20 @@
|
|||||||
|
|
||||||
{% include "snippets/file_share_popup.html" %}
|
{% include "snippets/file_share_popup.html" %}
|
||||||
|
|
||||||
<ul id="fileview-toolbar">
|
<div id="fileview-toolbar">
|
||||||
{% if groups %}
|
<ul class="fileview-toolbar">
|
||||||
<li class="item" id="file-discuss-icon"><img src="{{MEDIA_URL}}img/discuss.png" alt="{% trans "discuss" %}" /></li>
|
{% if groups %}
|
||||||
<li id="file-group-icon" class="item"><img src="{{MEDIA_URL}}img/groups.png" alt="{% trans "group" %}" /></li>
|
<li class="item" id="file-discuss-icon"><img src="{{MEDIA_URL}}img/discuss.png" alt="{% trans "discuss" %}" /></li>
|
||||||
{% endif %}
|
<li id="file-group-icon" class="item"><img src="{{MEDIA_URL}}img/groups.png" alt="{% trans "group" %}" /></li>
|
||||||
{% if not repo.encrypted %}
|
{% endif %}
|
||||||
<li id="share" class="item" data-link="{{ file_shared_link }}" data-token="{{ fileshare.token }}"><img src="{{MEDIA_URL}}img/share.png" alt="{% trans "share"%}" /></li>
|
{% if not repo.encrypted %}
|
||||||
{% endif %}
|
<li id="share" class="item" data-link="{{ file_shared_link }}" data-token="{{ fileshare.token }}"><img src="{{MEDIA_URL}}img/share.png" alt="{% trans "share"%}" /></li>
|
||||||
{% if user_perm == 'rw' %}
|
{% endif %}
|
||||||
<li id="history" class="item" data-url="{% url 'file_revisions' repo.id %}?p={{ path|urlencode }}"><img src="{{MEDIA_URL}}img/history.png" alt="{% trans "history"%}" />
|
{% if user_perm == 'rw' %}
|
||||||
{% endif %}
|
<li id="history" class="item" data-url="{% url 'file_revisions' repo.id %}?p={{ path|urlencode }}"><img src="{{MEDIA_URL}}img/history.png" alt="{% trans "history"%}" />
|
||||||
</ul>
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
<div>
|
||||||
|
|
||||||
{% if groups %}
|
{% if groups %}
|
||||||
<div id="discuss-to-group" class="hide">
|
<div id="discuss-to-group" class="hide">
|
||||||
@@ -228,12 +231,30 @@ $('#star').click(function() {
|
|||||||
// set 'side toolbar' & 'groups' popup position
|
// set 'side toolbar' & 'groups' popup position
|
||||||
function setToolbarPos() {
|
function setToolbarPos() {
|
||||||
var toolbar = $('#fileview-toolbar');
|
var toolbar = $('#fileview-toolbar');
|
||||||
|
|
||||||
|
// set toolbar pos
|
||||||
toolbar.css({'top': ($(window).height() - toolbar.outerHeight())/2});
|
toolbar.css({'top': ($(window).height() - toolbar.outerHeight())/2});
|
||||||
|
|
||||||
// set 'groups' popup position
|
// set 'groups' popup position
|
||||||
$('#to-group').css({'top': parseInt(toolbar.css('top')) + 59});
|
$('#to-group').css({'top': parseInt(toolbar.css('top')) + 59});
|
||||||
}
|
}
|
||||||
$(window).load(setToolbarPos).resize(setToolbarPos);
|
$(window).load(function() {
|
||||||
|
// if page needs scroll, show 'back-to-top' icon
|
||||||
|
if ($(document).height() > $(window).height()) {
|
||||||
|
var to_top = $('<ul class="fileview-toolbar hide" style="margin-top:3px;"><li class="item"><img src="{{MEDIA_URL}}img/top.png" alt="{% trans "top" %}" /></li></ul>');
|
||||||
|
to_top.click(function() {
|
||||||
|
$(window).scrollTop(0);
|
||||||
|
}).appendTo($('#fileview-toolbar'));
|
||||||
|
$(window).scroll(function() {
|
||||||
|
if ($(window).scrollTop() > 0) {
|
||||||
|
to_top.show();
|
||||||
|
} else {
|
||||||
|
to_top.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setToolbarPos();
|
||||||
|
}).resize(setToolbarPos);
|
||||||
|
|
||||||
// handle discussions after fetch them
|
// handle discussions after fetch them
|
||||||
function handleDiscussions(html) {
|
function handleDiscussions(html) {
|
||||||
|
Reference in New Issue
Block a user