From 629c925e77203b8e4270a9c2feb3166a68f76d72 Mon Sep 17 00:00:00 2001 From: Jan Graichen Date: Fri, 19 Oct 2018 12:34:12 +0200 Subject: [PATCH] Fix setting active file in editor The file select hook did construct an active_file but did not assign it to the actual variables. This commit changes the hook to use the existing setActiveFile helper function. --- app/assets/javascripts/editor/editor.js.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 1e254dd3..0ff03915 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -269,11 +269,11 @@ configureEditors: function () { initializeFileTree: function () { $('#files').jstree($('#files').data('entries')); $('#files').on('click', 'li.jstree-leaf', function (event) { - active_file = { + this.setActiveFile( filename: $(event.target).parent().text(), id: parseInt($(event.target).parent().attr('id')) - }; - var frame = $('[data-file-id="' + active_file.id + '"]').parent(); + ); + var frame = $('[data-file-id="' + this.active_file.id + '"]').parent(); this.showFrame(frame); this.toggleButtonStates(); }.bind(this));