File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -80,18 +80,18 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
8080 return scope && scope . css ;
8181 }
8282 set css ( value : string ) {
83- this . updateStyleScope ( undefined , undefined , value ) ;
83+ this . _updateStyleScope ( undefined , undefined , value ) ;
8484 }
8585
8686 public addCss ( cssString : string ) : void {
87- this . updateStyleScope ( undefined , cssString ) ;
87+ this . _updateStyleScope ( undefined , cssString ) ;
8888 }
8989
9090 public addCssFile ( cssFileName : string ) {
91- this . updateStyleScope ( cssFileName ) ;
91+ this . _updateStyleScope ( cssFileName ) ;
9292 }
9393
94- private updateStyleScope ( cssFileName ?: string , cssString ?: string , css ?: string ) : void {
94+ public _updateStyleScope ( cssFileName ?: string , cssString ?: string , css ?: string ) : void {
9595 let scope = this . _styleScope ;
9696 if ( ! scope ) {
9797 scope = new StyleScope ( ) ;
@@ -117,7 +117,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
117117 _setupAsRootView ( context : any ) : void {
118118 super . _setupAsRootView ( context ) ;
119119 if ( ! this . _styleScope ) {
120- this . updateStyleScope ( ) ;
120+ this . _updateStyleScope ( ) ;
121121 }
122122 }
123123
Original file line number Diff line number Diff line change @@ -658,6 +658,14 @@ export abstract class View extends ViewBase {
658658 * @param cssFileName - A valid file name (from the application root) which contains a valid css.
659659 */
660660 addCssFile ( cssFileName : string ) : void ;
661+
662+ /**
663+ * Updates styleScope or create new styleScope.
664+ * @param cssFileName
665+ * @param cssString
666+ * @param css
667+ */
668+ _updateStyleScope ( cssFileName ?: string , cssString ?: string , css ?: string ) : void ;
661669 //@endprivate
662670
663671 /**
Original file line number Diff line number Diff line change @@ -657,6 +657,11 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
657657 page . _setupUI ( context ) ;
658658 }
659659 } else {
660+ if ( ! this . frame . _styleScope ) {
661+ // Make sure page will have styleScope even if parents don't.
662+ page . _updateStyleScope ( ) ;
663+ }
664+
660665 this . frame . _addView ( page ) ;
661666 }
662667
You can’t perform that action at this time.
0 commit comments