| 39 | private scopedCssVariables = new Map<string, string>(); |
| 40 | |
| 41 | constructor(ownerView: ViewBase | WeakRef<ViewBase>) { |
| 42 | super(); |
| 43 | |
| 44 | // HACK: Could not find better way for cross platform WeakRef type checking. |
| 45 | if (ownerView.constructor.toString().indexOf('[native code]') !== -1 || ownerView.toString() == '[object WeakRef]') { |
| 46 | this.viewRef = <WeakRef<ViewBase>>ownerView; |
| 47 | } else { |
| 48 | this.viewRef = new WeakRef(<ViewBase>ownerView); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | public setScopedCssVariable(varName: string, value: string): void { |
| 53 | this.scopedCssVariables.set(varName, value); |