From 886a65f7be98bd995749f6b0c889fa388d4d7eab Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 27 Mar 2014 10:10:05 -0400 Subject: [PATCH] fix(dom) setCurrentFile: add CENTER --- lib/client/dom.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 41f1f442..b32a8815 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1059,24 +1059,25 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; * unified way to set current file */ this.setCurrentFile = function(currentFile) { - var lRet, - lCurrentFileWas = this.getCurrentFile(); + var ret, + CENTER = true, + currentFileWas = this.getCurrentFile(); if (currentFile) { - if (lCurrentFileWas) - unsetCurrentFile(lCurrentFileWas); + if (currentFileWas) + unsetCurrentFile(currentFileWas); this.addClass(currentFile, CURRENT_FILE); /* scrolling to current file */ - this.scrollIntoViewIfNeeded(currentFile); + this.scrollIntoViewIfNeeded(currentFile, CENTER); - lRet = true; + ret = true; Cmd.updateCurrentInfo(); } - return lRet; + return this; }; /**