Comparing version 3.0.1 to 3.0.2
@@ -78,2 +78,9 @@ /** | ||
/** | ||
* Called when the UI closes. Override to do any specific cleanup necessary | ||
*/ | ||
Prompt.prototype.close = function () { | ||
this.screen.releaseCursor(); | ||
}; | ||
/** | ||
* Run the provided validation method each time a submit event occur. | ||
@@ -80,0 +87,0 @@ * @param {Rx.Observable} submit - submit event flow |
@@ -32,3 +32,2 @@ 'use strict'; | ||
this.close(); | ||
console.log('\n'); // Line return | ||
}; | ||
@@ -45,4 +44,5 @@ | ||
// Restore prompt functionnalities | ||
this.rl.output.unmute(); | ||
if (this.activePrompt && typeof this.activePrompt.close === 'function') { | ||
this.activePrompt.close(); | ||
} | ||
@@ -49,0 +49,0 @@ // Close the readline |
@@ -76,8 +76,8 @@ 'use strict'; | ||
var Prompt = this.prompts[question.type]; | ||
var prompt = new Prompt(question, this.rl, this.answers); | ||
this.activePrompt = new Prompt(question, this.rl, this.answers); | ||
return rx.Observable.defer(function () { | ||
return rx.Observable.fromPromise(prompt.run().then(function (answer) { | ||
return rx.Observable.fromPromise(this.activePrompt.run().then(function (answer) { | ||
return {name: question.name, answer: answer}; | ||
})); | ||
}); | ||
}.bind(this)); | ||
}; | ||
@@ -84,0 +84,0 @@ |
@@ -18,2 +18,3 @@ 'use strict'; | ||
pageSize = pageSize || 7; | ||
var middleOfList = Math.floor(pageSize / 2); | ||
var lines = output.split('\n'); | ||
@@ -26,5 +27,5 @@ | ||
// Move the pointer only when the user go down and limit it to 3 | ||
if (this.pointer < 3 && this.lastIndex < active && active - this.lastIndex < 9) { | ||
this.pointer = Math.min(3, this.pointer + active - this.lastIndex); | ||
// Move the pointer only when the user go down and limit it to the middle of the list | ||
if (this.pointer < middleOfList && this.lastIndex < active && active - this.lastIndex < 9) { | ||
this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex); | ||
} | ||
@@ -31,0 +32,0 @@ this.lastIndex = active; |
@@ -101,2 +101,9 @@ 'use strict'; | ||
ScreenManager.prototype.releaseCursor = function () { | ||
if (this.extraLinesUnderPrompt > 0) { | ||
util.down(this.rl, this.extraLinesUnderPrompt); | ||
} | ||
this.done(); | ||
}; | ||
ScreenManager.prototype.normalizedCliWidth = function () { | ||
@@ -103,0 +110,0 @@ var width = cliWidth({ |
{ | ||
"name": "inquirer", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -50,3 +50,3 @@ "author": "Simon Boudrias <admin@simonboudrias.com>", | ||
"gulp-line-ending-corrector": "^1.0.1", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-mocha": "^3.0.0", | ||
"gulp-nsp": "^2.1.0", | ||
@@ -53,0 +53,0 @@ "gulp-plumber": "^1.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68983
1843