Merge pull request #323 from ilvalle/comment

select the right app in the file list editor sidebar
This commit is contained in:
mdipierro committed 2013-12-10 06:34:20 -08:00
commit a37206e259
2 files changed
+12 -11

No files matched your search

+1 -1
View File
@@ -1414,7 +1414,7 @@ def editfile(path,file,vars={}, app = None):
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;') return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
def files_menu(): def files_menu():
app = 'welcome'#request.args[0] app = request.vars.app or 'welcome'
dirs=[{'name':'models', 'reg':'.*\.py$'}, dirs=[{'name':'models', 'reg':'.*\.py$'},
{'name':'controllers', 'reg':'.*\.py$'}, {'name':'controllers', 'reg':'.*\.py$'},
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'}, {'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
+11 -10
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();
} }
}); });
}}); }});
@@ -267,7 +268,7 @@ $(document).on('click', 'a.font_button', function (e) {
</div> </div>
<br /> <br />
<div id="files_menu"> <div id="files_menu">
{{=LOAD('default', 'files_menu', args=['welcome'])}} {{=LOAD('default', 'files_menu', vars={'app':app})}}
</div> </div>
</ul> </ul>
</div> </div>