8000 adding bigger click area for show-file function · jstacoder/flask-ide@c4b8432 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4b8432

Browse files
committed
adding bigger click area for show-file function
1 parent 78e1ccd commit c4b8432

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

flask_ide/fileviewer/templates/view_files.html

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{% extends base or 'layout.html' %}
2-
{#{% from 'icons.html' import icon as get_icon %}#}
3-
{% macro get_icon(name,lib='glyphicon') %}
4-
<span class="{{lib}} {{lib}}-{{name}}"></span>
5-
{% endmacro %}
2+
{% from 'icons.html' import icon as get_icon %}
63
{% macro file_type(file_pth) %}
74
{%- if file_pth.endswith('.py') -%}
85
{%- set _type = 'python' -%}
@@ -131,11 +128,19 @@
131128

132129
{% macro render_grid_filelist(files) %}
133130
<div class="filelist hidden" id="grid-filelist">
134-
<div class="list-group inline">
131+
<div class=row>
135132
{% for name,link in files %}
136-
{% if loop.index % 4 == 0 %}
133+
{% if loop.first %}
134+
<div class=col-md-3>
135+
<div class="list-group inline">
136+
{% elif loop.index % 4 == 0 and not loop.last %}
137+
</div>
138+
</div>
139+
<div class=col-md-3>
140+
<div class="list-group inline">
141+
{% elif loop.last %}
142+
</div>
137143
</div>
138-
<div class="list-group inline">
139144
{% endif %}
140145
{% call get_url_link(link,class_='list-group-item inline') %}
141146
{{name}}
@@ -251,8 +256,7 @@
251256
margin-bottom:-25px;
252257
}
253258
.filelist table td {
254-
255-
259+
cursor:pointer;
256260
}
257261

258262
.CodeMirror-fullscreen {
@@ -495,6 +499,15 @@ <h4 class="modal-title" id="myModalLabel"></h4>
495499
$("#myModal").modal();
496500
});
497501
});
502+
$(document).on("click","td.show-file.info",function(){
503+
var path = $(this).parent().attr("data-path");
504+
console.log(path.split('/'));
505+
var content = $.get(SCRIPT_ROOT+"view_files/file/"+path).success(function(r){
506+
$(".modal-body").empty().html(r['content']);
507+
$("#myModalLabel").empty().text("/"+path);
508+
$("#myModal").modal();
509+
});
510+
});
498511
$(document).on("click",".prev_next",function(){
499512
if($(this).hasClass("disabled")){
500513
$(this).removeClass("disabled");
@@ -518,4 +531,4 @@ <h4 class="modal-title" id="myModalLabel"></h4>
518531
});
519532
});
520533
</script>
521-
{% endblock %}
534+
{% endblock %}

0 commit comments

Comments
 (0)
0