mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-16 08:16:55 +00:00
[file-edit]fixed a bug for ie
This commit is contained in:
parent
12a6e0a87f
commit
f8aba3d7ff
@ -78,7 +78,7 @@ $('#file-edit-submit').click(function () {
|
|||||||
var content = editor.session.getValue();
|
var content = editor.session.getValue();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '{{ SITE_ROOT }}repo/{{repo.id}}/file/edit/?p={{path}}',
|
url: '{{ SITE_ROOT }}repo/{{repo.id}}/file/edit/?p={{path|urlencode}}',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
cache: false,
|
cache: false,
|
||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
@ -89,8 +89,7 @@ $('#file-edit-submit').click(function () {
|
|||||||
},
|
},
|
||||||
error: function(xhr, ajaxOptions, thrownError) {
|
error: function(xhr, ajaxOptions, thrownError) {
|
||||||
var jsonVal = jQuery.parseJSON(xhr.responseText);
|
var jsonVal = jQuery.parseJSON(xhr.responseText);
|
||||||
$('#file-view').html('<p class="error">' + jsonVal['error'] + '</p>');
|
$('#op-after-edit').prepend('<p class="error">' + jsonVal['error'] + '</p>');
|
||||||
$('#file-edit-submit').addClass('hide');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -100,7 +99,7 @@ $('#file-edit-cancel').click(function() {
|
|||||||
{% endifnotequal %}
|
{% endifnotequal %}
|
||||||
|
|
||||||
{% if err %}
|
{% if err %}
|
||||||
$('#file-view').html('<p class="error">{{ err }}</p>');
|
$('#file').html('<p class="error">{{ err }}</p>');
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user