From 3ae6b4370452e7b5e381a06f12cf3401cd51d0fd Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 11 Jan 2017 23:04:01 +0000 Subject: [PATCH] Merge activeFileTab into sole caller --- src/app.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index d331d7acc9..aee5672e66 100644 --- a/src/app.js +++ b/src/app.js @@ -280,11 +280,6 @@ var run = function () { return false } - function activeFileTab () { - var name = utils.fileNameFromKey(editor.getCacheFile()) - return $('#files .file').filter(function () { return $(this).find('.name').text() === name }) - } - function updateFiles () { var $filesEl = $('#files') var files = editor.getFiles() @@ -298,7 +293,8 @@ var run = function () { } if (editor.cacheFileIsPresent()) { - var active = activeFileTab() + var currentFileName = utils.fileNameFromKey(editor.getCacheFile()) + var active = $('#files .file').filter(function () { return $(this).find('.name').text() === currentFileName }) active.addClass('active') editor.resetSession() }