@@ -221,6 +221,7 @@ export class View {
221221 constructor ( ) {
222222 this . uid = 0 ;
223223 this . scopes = [ ] ;
224+ this . hideScrollbar = false ;
224225 this . preventNavigation = false ;
225226
226227 if ( trace ) {
@@ -317,7 +318,7 @@ export class View {
317318 return ;
318319 }
319320
320- let hideScrollbar = false ;
321+ let hideScrollbar = this . layers ( ) > 2 ? this . hideScrollbar : false ;
321322 let disableScrolling = false ;
322323 let disableNavigationGestures = false ;
323324 let preventNavigation = uid > 0 && ! name . startsWith ( "PPage" ) ;
@@ -351,6 +352,7 @@ export class View {
351352 break ;
352353 }
353354
355+ this . hideScrollbar = hideScrollbar ;
354356 this . preventNavigation = preventNavigation ;
355357
356358 const htmlEl = getHtmlElement ( ) ;
@@ -429,6 +431,11 @@ export class View {
429431 return true ;
430432 }
431433
434+ // Returns the current number of view layers.
435+ layers ( ) {
436+ return this . scopes ?. length ? this . scopes . length : 0 ;
437+ }
438+
432439 // Returns the currently active view component or null if none exists.
433440 current ( ) {
434441 if ( this . scopes . length ) {
@@ -438,6 +445,26 @@ export class View {
438445 }
439446 }
440447
448+ // Returns the parent view of the currently active view or null if none exists.
449+ parent ( ) {
450+ if ( this . scopes . length > 1 ) {
451+ return this . scopes [ this . scopes . length - 2 ] ;
452+ } else {
453+ return null ;
454+ }
455+ }
456+
457+ // Returns the name of the parent view component or an empty string if none exists.
458+ parentName ( ) {
459+ const c = this . parent ( ) ;
460+
461+ if ( ! c ) {
462+ return "" ;
463+ }
464+
465+ return c ?. $options ?. name ? c . $options . name : "" ;
466+ }
467+
441468 // Returns the currently active view data or an empty reactive object otherwise.
442469 data ( ) {
443470 const c = this . current ( ) ;
0 commit comments