Skip to content

Commit 0e8927e

Browse files
committed
fix debug populate variables
1 parent 4f926f5 commit 0e8927e

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

public/javascripts/editor.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,17 @@
337337
}
338338

339339
function debug_file_response(data) {
340+
function populate_variables(data) {
341+
$('#variables-wrapper pre').text("");
342+
for (var i=0; i<data.length; i++) {
343+
if (data[i].name && data[i].content && data[i].type) {
344+
var content = data[i].name + ": " + data[i].content + '\n';
345+
$('#variables-wrapper pre').append(document.createTextNode(content));
346+
}
347+
348+
}
349+
}
350+
340351
occEditor.debug_toggle_buttons(true);
341352
occEditor.debug_message('Ready');
342353
//console.log(data);
@@ -663,7 +674,7 @@
663674
if (is_script(file.extension)) {
664675
$(templates.editor_bar_run_link).appendTo('.editor-bar-actions');
665676
$(templates.editor_bar_debug_link).appendTo('.editor-bar-actions');
666-
677+
667678
//$(templates.editor_bar_trace_link).appendTo('.editor-bar-actions');
668679
}
669680

@@ -1096,19 +1107,6 @@
10961107
return !$link.hasClass('debug-link-disabled');
10971108
}
10981109

1099-
function populate_variables(data) {
1100-
$('#variables-wrapper pre').text("");
1101-
for (var i=0; i<data.length; i++) {
1102-
if (data[i].name && data[i].content && data[i].type) {
1103-
var content = data[i].name + ": " + data[i].content + '\n';
1104-
$('#variables-wrapper pre').append(document.createTextNode(content));
1105-
}
1106-
1107-
}
1108-
}
1109-
1110-
1111-
11121110
function get_breakpoints() {
11131111
var editor_breakpoints = editor.getSession().getBreakpoints();
11141112
var breakpoints = "";
@@ -1198,7 +1196,6 @@
11981196
occEditor.populate_editor(file);
11991197

12001198
//clean up listeners
1201-
socket.removeAllListeners('debug-file-response');
12021199
$(document).off('click touchstart', '.debug-step-over');
12031200
$(document).off('click touchstart', '.debug-step-in');
12041201
$(document).off('click touchstart', '.debug-run');

0 commit comments

Comments
 (0)