todolist panel (frontend part), by clicking on the TODO the relatve file is opened in a tab and the cursor is placed at the right line

This commit is contained in:
ilvalle
2013-12-06 12:37:33 +01:00
parent 557e4892b0
commit b7192d706c
6 changed files with 63 additions and 40 deletions
@@ -3,6 +3,11 @@
.CodeMirror-fullscreen {
z-index: 1030;
}
.CodeMirror {
border-top: 1px solid #ddd;
/*border-left: 1px solid #ddd;*/
border-bottom: 1px solid #ddd;
}
/* BREAKPOINTS */
+4 -4
View File
@@ -248,7 +248,7 @@ function keepalive(url) {
});
}
function load_file(url) {
function load_file(url, lineno) {
$.ajax({
type: "GET",
contentType: 'application/json',
@@ -263,13 +263,13 @@ function load_file(url) {
var tab_header = '<li><a title="'+ json['filename'] +'" href="#' + json['id'] + '" data-toggle="tab"><button type="button" class="close">&times;</button>' + json['realfilename'] + '</a></li>';
var tab_body = '<div id="' + json['id'] + '" class="tab-pane fade in " >' + json['plain_html'] + '</div>';
if(json['force'] === false) {
$('#filesTab').append($(tab_header));
$('#myTabContent').append($(tab_body));
$('#myTabContent').append($(tab_body)); // First load the body
$('#filesTab').append($(tab_header)); // Then load the header which trigger the shown event
} else {
$('#' + json['id']).html($(tab_body));
}
}
$("a[href='#" + json['id'] + "']").click();
$("a[href='#" + json['id'] + "']").trigger('click', lineno);
}
},
error: function (x) {