mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-28 08:06:56 +00:00
[bugfix] fixed bug in 'set notice read by id' & file view 'back to top'(for pdf)
This commit is contained in:
@@ -70,10 +70,18 @@ $(function() {
|
||||
// set a notice to be read when <a> in it is clicked
|
||||
$('.unread a', notice_list).click(function() {
|
||||
var notice_id = $(this).parents('.unread').data('id');
|
||||
var link_href = $(this).attr('href');
|
||||
$.ajax({
|
||||
url: notice_list.data('url') + '?notice_id=' + e(notice_id),
|
||||
dataType:'json'
|
||||
dataType:'json',
|
||||
success: function(data) {
|
||||
location.href = link_href;
|
||||
},
|
||||
error: function() {
|
||||
location.href = link_href;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.detail', notice_list).click(function() {
|
||||
|
@@ -239,20 +239,17 @@ function setToolbarPos() {
|
||||
$('#to-group').css({'top': parseInt(toolbar.css('top')) + 59});
|
||||
}
|
||||
$(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" title="{% trans "Back to top" %}"><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();
|
||||
}
|
||||
});
|
||||
}
|
||||
var to_top = $('<ul class="fileview-toolbar hide" style="margin-top:3px;"><li class="item" title="{% trans "Back to top" %}"><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);
|
||||
|
||||
|
Reference in New Issue
Block a user