@@ -25,7 +25,7 @@ class ContextButton<x, y> implements menuPart<x, y> {
2525 private text : string | ( ( this : x , arg : y ) => string ) ;
2626 private onClick : ( this : x , arg : y , e : MouseEvent ) => void ;
2727 private icon ?: iconJson ;
28- private visable ?: ( this : x , arg : y ) => boolean ;
28+ private visible ?: ( this : x , arg : y ) => boolean ;
2929 private enabled ?: ( this : x , arg : y ) => boolean ;
3030 //TODO there *will* be more colors
3131 private color ?: "red" | "blue" ;
@@ -35,7 +35,7 @@ class ContextButton<x, y> implements menuPart<x, y> {
3535 onClick : ContextButton < x , y > [ "onClick" ] ,
3636 addProps : {
3737 icon ?: iconJson ;
38- visable ?: ( this : x , arg : y ) => boolean ;
38+ visible ?: ( this : x , arg : y ) => boolean ;
3939 enabled ?: ( this : x , arg : y ) => boolean ;
4040 color ?: "red" | "blue" ;
4141 group ?: string ;
@@ -44,17 +44,17 @@ class ContextButton<x, y> implements menuPart<x, y> {
4444 this . text = text ;
4545 this . onClick = onClick ;
4646 this . icon = addProps . icon ;
47- this . visable = addProps . visable ;
47+ this . visible = addProps . visible ;
4848 this . enabled = addProps . enabled ;
4949 this . color = addProps . color ;
5050 this . group = addProps . group ;
5151 }
52- isVisable ( obj1 : x , obj2 : y ) : boolean {
53- if ( ! this . visable ) return true ;
54- return this . visable . call ( obj1 , obj2 ) ;
52+ isVisible ( obj1 : x , obj2 : y ) : boolean {
53+ if ( ! this . visible ) return true ;
54+ return this . visible . call ( obj1 , obj2 ) ;
5555 }
5656 makeContextHTML ( obj1 : x , obj2 : y , menu : HTMLDivElement ) {
57- if ( ! this . isVisable ( obj1 , obj2 ) ) {
57+ if ( ! this . isVisible ( obj1 , obj2 ) ) {
5858 return ;
5959 }
6060
@@ -113,22 +113,22 @@ class ContextButton<x, y> implements menuPart<x, y> {
113113 }
114114}
115115class ContextGroup < x , y > implements menuPart < x , y > {
116- private visable ?: ( this : x , arg : y ) => boolean ;
116+ private visible ?: ( this : x , arg : y ) => boolean ;
117117 groupSel : string ;
118118 group = undefined ;
119119 constructor (
120120 group : string ,
121121 addProps : {
122- visable ?: ( this : x , arg : y ) => boolean ;
122+ visible ?: ( this : x , arg : y ) => boolean ;
123123 } = { } ,
124124 ) {
125- this . visable = addProps . visable ;
125+ this . visible = addProps . visible ;
126126
127127 this . groupSel = group ;
128128 }
129- isVisable ( obj1 : x , obj2 : y ) : boolean {
130- if ( ! this . visable ) return true ;
131- return this . visable . call ( obj1 , obj2 ) ;
129+ isVisible ( obj1 : x , obj2 : y ) : boolean {
130+ if ( ! this . visible ) return true ;
131+ return this . visible . call ( obj1 , obj2 ) ;
132132 }
133133 makeContextHTML (
134134 x : x ,
@@ -137,7 +137,7 @@ class ContextGroup<x, y> implements menuPart<x, y> {
137137 layered : contextCluster < unknown , unknown > [ ] ,
138138 processed : WeakSet < menuPart < unknown , unknown > > ,
139139 ) {
140- if ( ! this . isVisable ( x , y ) ) {
140+ if ( ! this . isVisible ( x , y ) ) {
141141 return ;
142142 }
143143 for ( const [ menu , x , y ] of layered ) {
@@ -151,14 +151,14 @@ class ContextGroup<x, y> implements menuPart<x, y> {
151151 }
152152}
153153class Seperator < x , y > implements menuPart < x , y > {
154- private visable ?: ( obj1 : x , obj2 : y ) => boolean ;
154+ private visible ?: ( obj1 : x , obj2 : y ) => boolean ;
155155 group ?: string ;
156- constructor ( visable ?: ( obj1 : x , obj2 : y ) => boolean , group ?: string ) {
157- this . visable = visable ;
156+ constructor ( visible ?: ( obj1 : x , obj2 : y ) => boolean , group ?: string ) {
157+ this . visible = visible ;
158158 this . group = group ;
159159 }
160160 makeContextHTML ( obj1 : x , obj2 : y , menu : HTMLDivElement ) : void {
161- if ( ! this . visable || this . visable ( obj1 , obj2 ) ) {
161+ if ( ! this . visible || this . visible ( obj1 , obj2 ) ) {
162162 if ( menu . children [ menu . children . length - 1 ] . tagName === "HR" ) {
163163 return ;
164164 }
@@ -236,21 +236,21 @@ class Contextmenu<x, y> {
236236 onClick : ContextButton < x , y > [ "onClick" ] ,
237237 addProps : {
238238 icon ?: iconJson ;
239- visable ?: ( this : x , arg : y ) => boolean ;
239+ visible ?: ( this : x , arg : y ) => boolean ;
240240 enabled ?: ( this : x , arg : y ) => boolean ;
241241 color ?: "red" | "blue" ;
242242 group ?: string ;
243243 } = { } ,
244244 ) {
245245 this . buttons . push ( new ContextButton ( text , onClick , addProps ) ) ;
246246 }
247- addSeperator ( visable ?: ( obj1 : x , obj2 : y ) => boolean , group ?: string ) {
248- this . buttons . push ( new Seperator ( visable , group ) ) ;
247+ addSeperator ( visible ?: ( obj1 : x , obj2 : y ) => boolean , group ?: string ) {
248+ this . buttons . push ( new Seperator ( visible , group ) ) ;
249249 }
250250 addGroup (
251251 group : string ,
252252 addprops ?: {
253- visable ?: ( this : x , arg : y ) => boolean ;
253+ visible ?: ( this : x , arg : y ) => boolean ;
254254 } ,
255255 ) {
256256 this . buttons . push ( new ContextGroup < x , y > ( group , addprops ) ) ;
0 commit comments