Merge pull request #323 from ilvalle/comment
select the right app in the file list editor sidebar
This commit is contained in:
@@ -1414,7 +1414,7 @@ def editfile(path,file,vars={}, app = None):
|
||||
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
|
||||
|
||||
def files_menu():
|
||||
app = 'welcome'#request.args[0]
|
||||
app = request.vars.app or 'welcome'
|
||||
dirs=[{'name':'models', 'reg':'.*\.py$'},
|
||||
{'name':'controllers', 'reg':'.*\.py$'},
|
||||
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
|
||||
|
||||
@@ -241,20 +241,21 @@ $(document).on('click', 'a.font_button', function (e) {
|
||||
<div>
|
||||
{{=file_create_form('%s/' % app, '')}}
|
||||
<script>
|
||||
jQuery("#btn_file_create").click(function() {
|
||||
jQuery.ajax({
|
||||
$("#btn_file_create").click(function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{=URL('create_file')}}",
|
||||
data: jQuery("#file_create_form").serialize(),
|
||||
dataType: 'JSON',
|
||||
success: function(data){
|
||||
jQuery(".flash").html(data["result"]);
|
||||
jQuery(".flash").show();
|
||||
jQuery.ajax({
|
||||
success: function(data){
|
||||
$(".flash").html(data["result"]);
|
||||
$(".flash").show();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{=URL('files_menu')}}",
|
||||
success: function(data){
|
||||
jQuery("#files_menu").html(data);
|
||||
url: "{{=URL('files_menu', vars={'app':app})}}",
|
||||
success: function(html_data){
|
||||
$("#files_menu").html(html_data);
|
||||
$(data['id_filename']).click();
|
||||
}
|
||||
});
|
||||
}});
|
||||
@@ -267,7 +268,7 @@ $(document).on('click', 'a.font_button', function (e) {
|
||||
</div>
|
||||
<br />
|
||||
<div id="files_menu">
|
||||
{{=LOAD('default', 'files_menu', args=['welcome'])}}
|
||||
{{=LOAD('default', 'files_menu', vars={'app':app})}}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user