mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 02:42:47 +00:00
[share links] removed links with ajax
This commit is contained in:
@@ -102,14 +102,22 @@ $(".view-link").click(function() {
|
||||
.modal({focus:false});
|
||||
$('#shared-link').prev().remove();
|
||||
});
|
||||
// rm shared_link
|
||||
$('.rm-link').click(function() {
|
||||
location.href = '{% url 'remove_shared_link' %}?t=' + $(this).attr('data-token');
|
||||
});
|
||||
// rm shared_upload_link
|
||||
$('.rm-upload-link').click(function() {
|
||||
location.href = '{% url 'remove_shared_upload_link' %}?t=' + $(this).attr('data-token');
|
||||
|
||||
// rm download/upload link
|
||||
$('.rm-link, .rm-upload-link').click(function() {
|
||||
var _this = $(this);
|
||||
$.ajax({
|
||||
url: $(this).hasClass('rm-link') ? '{% url 'ajax_remove_shared_link' %}' : '{% url 'ajax_remove_shared_upload_link' %}',
|
||||
data: {'t': $(this).attr('data-token')},
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
success: function() {
|
||||
_this.closest('tr').remove();
|
||||
},
|
||||
error: ajaxErrorHandler
|
||||
});
|
||||
});
|
||||
|
||||
$('#shared-link').click(function() {
|
||||
$(this).select();
|
||||
});
|
||||
|
Reference in New Issue
Block a user