1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-15 16:04:01 +00:00

[file-edit]fixed a bug for ie

This commit is contained in:
llj 2012-09-01 20:32:43 +08:00
parent 12a6e0a87f
commit f8aba3d7ff

View File

@ -78,7 +78,7 @@ $('#file-edit-submit').click(function () {
var content = editor.session.getValue();
$.ajax({
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',
cache: false,
contentType: 'application/json; charset=utf-8',
@ -89,8 +89,7 @@ $('#file-edit-submit').click(function () {
},
error: function(xhr, ajaxOptions, thrownError) {
var jsonVal = jQuery.parseJSON(xhr.responseText);
$('#file-view').html('<p class="error">' + jsonVal['error'] + '</p>');
$('#file-edit-submit').addClass('hide');
$('#op-after-edit').prepend('<p class="error">' + jsonVal['error'] + '</p>');
}
});
});
@ -100,7 +99,7 @@ $('#file-edit-cancel').click(function() {
{% endifnotequal %}
{% if err %}
$('#file-view').html('<p class="error">{{ err }}</p>');
$('#file').html('<p class="error">{{ err }}</p>');
{% endif %}
</script>
{% endblock %}