From f8aba3d7ff9cf1e9d73a1b79244acd2fffb43738 Mon Sep 17 00:00:00 2001 From: llj Date: Sat, 1 Sep 2012 20:32:43 +0800 Subject: [PATCH] [file-edit]fixed a bug for ie --- templates/repo_edit_file.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/repo_edit_file.html b/templates/repo_edit_file.html index 72032bab09..168e8ce558 100644 --- a/templates/repo_edit_file.html +++ b/templates/repo_edit_file.html @@ -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('

' + jsonVal['error'] + '

'); - $('#file-edit-submit').addClass('hide'); + $('#op-after-edit').prepend('

' + jsonVal['error'] + '

'); } }); }); @@ -100,7 +99,7 @@ $('#file-edit-cancel').click(function() { {% endifnotequal %} {% if err %} -$('#file-view').html('

{{ err }}

'); +$('#file').html('

{{ err }}

'); {% endif %} {% endblock %}