mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-24 09:49:04 +00:00
small pick method improvement.
This commit is contained in:
parent
8015a8fd1c
commit
9fd97f0b03
@ -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();
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user