Skip to content

Commit

Permalink
NextGenEvents updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cronvel committed Aug 13, 2016
1 parent c553bd8 commit d9b9e8f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

v0.24.23
--------

NextGenEvents updated


v0.24.22
--------

Expand Down
18 changes: 11 additions & 7 deletions lib/inputField.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ module.exports = function inputField( options , callback )
}

self.on( 'key' , onKey ) ;
controler.ready = true ;
//controler.ready = true ;
controler.emit( 'ready' ) ;
} ;

Expand Down Expand Up @@ -728,8 +728,12 @@ module.exports = function inputField( options , callback )

controler = Object.create( NextGenEvents.prototype ) ;

// Ready?
controler.ready = false ;
controler.defineStates( 'ready' ) ;

// /!\ .ready is deprecated, it is now a getter to .hasState('ready')
Object.defineProperty( controler , 'ready' , {
get: function() { return this.hasState( 'ready' ) ; }
} ) ;

// Tmp, for compatibility
controler.widgetType = 'inputField' ;
Expand Down Expand Up @@ -772,7 +776,7 @@ module.exports = function inputField( options , callback )
// Hide the input field
controler.hide = function controlerHide()
{
if ( ! controler.ready ) { controler.once( 'ready' , controler.hide ) ; return ; }
if ( ! controler.hasState( 'ready' ) ) { controler.once( 'ready' , controler.hide ) ; return ; }

var i , j ;

Expand All @@ -787,7 +791,7 @@ module.exports = function inputField( options , callback )
// Show the input field
controler.show = function controlerShow()
{
if ( ! controler.ready ) { controler.once( 'ready' , controler.show ) ; return ; }
if ( ! controler.hasState( 'ready' ) ) { controler.once( 'ready' , controler.show ) ; return ; }

echo = true ;
redraw() ;
Expand All @@ -796,7 +800,7 @@ module.exports = function inputField( options , callback )
// Redraw the input field
controler.redraw = function controlerRedraw()
{
if ( ! controler.ready ) { controler.once( 'ready' , controler.redraw ) ; return ; }
if ( ! controler.hasState( 'ready' ) ) { controler.once( 'ready' , controler.redraw ) ; return ; }

redraw() ;
} ;
Expand All @@ -805,7 +809,7 @@ module.exports = function inputField( options , callback )
controler.rebase = function controlerRebase()
{
if ( ! inlineMode ) { return ; }
if ( ! controler.ready ) { controler.once( 'ready' , controler.rebase ) ; return ; }
if ( ! controler.hasState( 'ready' ) ) { controler.once( 'ready' , controler.rebase ) ; return ; }

// First, disable echoing: getCursorLocation is async!
echo = false ;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "terminal-kit",
"version": "0.24.22",
"version": "0.24.23",
"description": "256 colors, keys & mouse, input field, screen buffer, interactive 'yes or no', and many more... Whether you just need colors & styles, build a simple interactive command line tool or a complexe terminal app: this is the absolute terminal lib for Node.js!",
"main": "lib/termkit.js",
"directories": {
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"async-kit": "^2.1.6",
"nextgen-events": "^0.9.0",
"nextgen-events": "^0.9.4",
"string-kit": "^0.5.10",
"tree-kit": "^0.5.26"
},
Expand Down

0 comments on commit d9b9e8f

Please sign in to comment.