fix reload of file list in editor when a new file is created

This commit is contained in:
ilvalle
2013-12-10 11:13:04 +01:00
parent 8244472cb2
commit ff94a22826
+10 -9
View File
@@ -241,20 +241,21 @@ $(document).on('click', 'a.font_button', function (e) {
<div> <div>
{{=file_create_form('%s/' % app, '')}} {{=file_create_form('%s/' % app, '')}}
<script> <script>
jQuery("#btn_file_create").click(function() { $("#btn_file_create").click(function() {
jQuery.ajax({ $.ajax({
type: "POST", type: "POST",
url: "{{=URL('create_file')}}", url: "{{=URL('create_file')}}",
data: jQuery("#file_create_form").serialize(), data: jQuery("#file_create_form").serialize(),
dataType: 'JSON', dataType: 'JSON',
success: function(data){ success: function(data){
jQuery(".flash").html(data["result"]); $(".flash").html(data["result"]);
jQuery(".flash").show(); $(".flash").show();
jQuery.ajax({ $.ajax({
type: "POST", type: "POST",
url: "{{=URL('files_menu')}}", url: "{{=URL('files_menu', vars={'app':app})}}",
success: function(data){ success: function(html_data){
jQuery("#files_menu").html(data); $("#files_menu").html(html_data);
$(data['id_filename']).click();
} }
}); });
}}); }});