Skip to content

Commit 773d52b

Browse files
committed
Fix a .destroy() bug on ColumnMenu's submenu (#151)
1 parent 52d4d85 commit 773d52b

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
v1.49.2
3+
-------
4+
5+
Fix a .destroy() bug on ColumnMenu's submenu (#151)
6+
7+
28
v1.49.1
39
-------
410

lib/document/BaseMenu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ BaseMenu.prototype.needInput = true ;
148148

149149
BaseMenu.prototype.destroy = function( isSubDestroy , noDraw = false ) {
150150
if ( this.destroyed ) { return ; }
151+
if ( this.submenu ) { this.submenu.destroy( true ) ; }
151152

152153
this.off( 'key' , this.onKey ) ;
153154
this.off( 'wheel' , this.onWheel ) ;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "terminal-kit",
3-
"version": "1.49.1",
3+
"version": "1.49.2",
44
"description": "256 colors, keys and mouse, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and many more... Whether you just need colors and styles, build a simple interactive command line tool or a complexe terminal app: this is the absolute terminal lib for Node.js!",
55
"main": "lib/termkit.js",
66
"directories": {

sample/document/column-menu-submenu-test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,17 @@ var columnMenu = new termkit.ColumnMenu( {
132132
} ,
133133
{
134134
content: 'Manual' ,
135-
value: 'manual'
135+
value: 'manual' ,
136+
items: [
137+
{
138+
content: 'Local' ,
139+
value: 'local'
140+
} ,
141+
{
142+
content: 'Online' ,
143+
value: 'online'
144+
}
145+
]
136146
}
137147
]
138148
}

0 commit comments

Comments
 (0)