small pick method improvement.

This commit is contained in:
Christopher Jeffrey 2013-07-12 11:30:20 -05:00
parent 8015a8fd1c
commit 9fd97f0b03
1 changed files with 13 additions and 12 deletions

View File

@ -3090,18 +3090,9 @@ FileManager.prototype.pick = function(cwd, callback) {
var self = this
, focused = this.screen.focused === this
, hidden = this.hidden;
if (hidden) {
this.show();
}
if (!focused) {
this.screen.saveFocus();
this.focus();
}
var onfile, oncancel;
, hidden = this.hidden
, onfile
, oncancel;
function resume() {
self.removeListener('file', onfile);
@ -3127,6 +3118,16 @@ FileManager.prototype.pick = function(cwd, callback) {
this.refresh(cwd, function(err) {
if (err) return callback(err);
if (hidden) {
self.show();
}
if (!focused) {
self.screen.saveFocus();
self.focus();
}
self.screen.render();
});
};