1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 11:21:29 +00:00

[share links] removed links with ajax

This commit is contained in:
llj
2015-08-07 16:56:26 +08:00
parent 78c11b009d
commit a678d2bc3d

View File

@@ -102,14 +102,22 @@ $(".view-link").click(function() {
.modal({focus:false}); .modal({focus:false});
$('#shared-link').prev().remove(); $('#shared-link').prev().remove();
}); });
// rm shared_link
$('.rm-link').click(function() { // rm download/upload link
location.href = '{% url 'remove_shared_link' %}?t=' + $(this).attr('data-token'); $('.rm-link, .rm-upload-link').click(function() {
}); var _this = $(this);
// rm shared_upload_link $.ajax({
$('.rm-upload-link').click(function() { url: $(this).hasClass('rm-link') ? '{% url 'ajax_remove_shared_link' %}' : '{% url 'ajax_remove_shared_upload_link' %}',
location.href = '{% url 'remove_shared_upload_link' %}?t=' + $(this).attr('data-token'); data: {'t': $(this).attr('data-token')},
cache: false,
dataType: 'json',
success: function() {
_this.closest('tr').remove();
},
error: ajaxErrorHandler
});
}); });
$('#shared-link').click(function() { $('#shared-link').click(function() {
$(this).select(); $(this).select();
}); });