File tree 3 files changed +18
-5
lines changed
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 {
80
80
return scope && scope . css ;
81
81
}
82
82
set css ( value : string ) {
83
- this . updateStyleScope ( undefined , undefined , value ) ;
83
+ this . _updateStyleScope ( undefined , undefined , value ) ;
84
84
}
85
85
86
86
public addCss ( cssString : string ) : void {
87
- this . updateStyleScope ( undefined , cssString ) ;
87
+ this . _updateStyleScope ( undefined , cssString ) ;
88
88
}
89
89
90
90
public addCssFile ( cssFileName : string ) {
91
- this . updateStyleScope ( cssFileName ) ;
91
+ this . _updateStyleScope ( cssFileName ) ;
92
92
}
93
93
94
- private updateStyleScope ( cssFileName ?: string , cssString ?: string , css ?: string ) : void {
94
+ public _updateStyleScope ( cssFileName ?: string , cssString ?: string , css ?: string ) : void {
95
95
let scope = this . _styleScope ;
96
96
if ( ! scope ) {
97
97
scope = new StyleScope ( ) ;
@@ -117,7 +117,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
117
117
_setupAsRootView ( context : any ) : void {
118
118
super . _setupAsRootView ( context ) ;
119
119
if ( ! this . _styleScope ) {
120
- this . updateStyleScope ( ) ;
120
+ this . _updateStyleScope ( ) ;
121
121
}
122
122
}
123
123
Original file line number Diff line number Diff line change @@ -658,6 +658,14 @@ export abstract class View extends ViewBase {
658
658
* @param cssFileName - A valid file name (from the application root) which contains a valid css.
659
659
*/
660
660
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 ;
661
669
//@endprivate
662
670
663
671
/**
Original file line number Diff line number Diff line change @@ -657,6 +657,11 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
657
657
page . _setupUI ( context ) ;
658
658
}
659
659
} else {
660
+ if ( ! this . frame . _styleScope ) {
661
+ // Make sure page will have styleScope even if parents don't.
662
+ page . _updateStyleScope ( ) ;
663
+ }
664
+
660
665
this . frame . _addView ( page ) ;
661
666
}
662
667
You can’t perform that action at this time.
0 commit comments