From 67cbc08b60a1eda20b3a23b8f23d89b6d27d6821 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 6 Sep 2012 07:58:40 +0100 Subject: [PATCH] Don't autoload files that are already open Check if files are already opened and if so, skip autoloading it --- lib/coder.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/coder.js b/lib/coder.js index ea88252..d3251fd 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -1537,10 +1537,15 @@ var ICEcoder = { // Opens the last files we had open autoOpenFiles: function() { + var loadFileURL; + for (var i=0;i<=top.previousFiles.length-1;i++) { - top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.previousFiles[i].replace('|','/'); - top.ICEcoder.thisFileFolderType='file'; - top.ICEcoder.openFile(); + loadFileURL = top.previousFiles[i].replace(/\|/g, "/").replace(top.docRoot+top.iceRoot,""); + if (top.ICEcoder.openFiles.indexOf(loadFileURL)==-1) { + top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.previousFiles[i].replace('|','/'); + top.ICEcoder.thisFileFolderType='file'; + top.ICEcoder.openFile(); + } } },