| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,6 +40,7 @@ import { | |||
| 40 | 40 | LoadAppCSSEventData, | |
| 41 | 41 | UnhandledErrorEventData | |
| 42 | 42 | } from "./application"; | |
| 43 | + import { CSS_CLASS_PREFIX } from "./application-utils"; | ||
| 43 | 44 | import { DeviceOrientation } from "../ui/enums/enums"; | |
| 44 | 45 | ||
| 45 | 46 | export { UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData }; | |
@@ -54,13 +55,6 @@ export const uncaughtErrorEvent = "uncaughtError"; | |||
| 54 | 55 | export const discardedErrorEvent = "discardedError"; | |
| 55 | 56 | export const orientationChangedEvent = "orientationChanged"; | |
| 56 | 57 | ||
| 57 | - const MODAL = "modal"; | ||
| 58 | - const ROOT = "root"; | ||
| 59 | - | ||
| 60 | - export const CSS_CLASS_PREFIX = "ns-"; | ||
| 61 | - export const MODAL_ROOT_VIEW_CSS_CLASS = `${CSS_CLASS_PREFIX}${MODAL}`; | ||
| 62 | - export const ROOT_VIEW_CSS_CLASSES = [`${CSS_CLASS_PREFIX}${ROOT}`]; | ||
| 63 | - | ||
| 64 | 58 | const ORIENTATION_CSS_CLASSES = [ | |
| 65 | 59 | `${CSS_CLASS_PREFIX}${DeviceOrientation.portrait}`, | |
| 66 | 60 | `${CSS_CLASS_PREFIX}${DeviceOrientation.landscape}`, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,23 @@ | |||
| 1 | + /** | ||
| 2 | + * Contains the application utils referenced in application and ui modules. | ||
| 3 | + * @module "application" | ||
| 4 | + */ /** */ | ||
| 5 | + | ||
| 6 | + /** | ||
| 7 | + * String value "ns-" used for CSS class prefix. | ||
| 8 | + */ | ||
| 9 | + export const CSS_CLASS_PREFIX: string; | ||
| 10 | + | ||
| 11 | + /** | ||
| 12 | + * String value "ns-modal" used for default CSS class of a modal root view. | ||
| 13 | + */ | ||
| 14 | + export const MODAL_ROOT_VIEW_CSS_CLASS: string; | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * Array of string values used for CSS classes of a root view. | ||
| 18 | + * Default value - "ns-root". | ||
| 19 | + * Platform values: "ns-android" and "ns-ios". | ||
| 20 | + * Device type values: "ns-phone" and "ns-tablet". | ||
| 21 | + * Orientation values: "ns-portrait", "ns-landscape" and "ns-unknown". | ||
| 22 | + */ | ||
| 23 | + export const ROOT_VIEW_CSS_CLASSES: string[]; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,6 @@ | |||
| 1 | + const MODAL = "modal"; | ||
| 2 | + const ROOT = "root"; | ||
| 3 | + | ||
| 4 | + export const CSS_CLASS_PREFIX = "ns-"; | ||
| 5 | + export const MODAL_ROOT_VIEW_CSS_CLASS = `${CSS_CLASS_PREFIX}${MODAL}`; | ||
| 6 | + export const ROOT_VIEW_CSS_CLASSES = [`${CSS_CLASS_PREFIX}${ROOT}`]; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,25 +53,6 @@ export const lowMemoryEvent: string; | |||
| 53 | 53 | */ | |
| 54 | 54 | export const orientationChangedEvent: string; | |
| 55 | 55 | ||
| 56 | - /** | ||
| 57 | - * String value "ns-" used for CSS class prefix. | ||
| 58 | - */ | ||
| 59 | - export const CSS_CLASS_PREFIX: string; | ||
| 60 | - | ||
| 61 | - /** | ||
| 62 | - * String value "ns-modal" used for default CSS class of a modal root view. | ||
| 63 | - */ | ||
| 64 | - export const MODAL_ROOT_VIEW_CSS_CLASS: string; | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * Array of string values used for CSS classes of a root view. | ||
| 68 | - * Default value - "ns-root". | ||
| 69 | - * Platform values: "ns-android" and "ns-ios". | ||
| 70 | - * Device type values: "ns-phone" and "ns-tablet". | ||
| 71 | - * Orientation values: "ns-portrait", "ns-landscape" and "ns-unknown". | ||
| 72 | - */ | ||
| 73 | - export const ROOT_VIEW_CSS_CLASSES: string[]; | ||
| 74 | - | ||
| 75 | 56 | /** | |
| 76 | 57 | * Event data containing information for the application events. | |
| 77 | 58 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,13 +8,15 @@ import { | |||
| 8 | 8 | } from "."; | |
| 9 | 9 | ||
| 10 | 10 | import { | |
| 11 | - CSS_CLASS_PREFIX, displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on, | ||
| 12 | - orientationChanged, orientationChangedEvent, resumeEvent, ROOT_VIEW_CSS_CLASSES, setApplication, suspendEvent | ||
| 11 | + displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on, | ||
| 12 | + orientationChanged, orientationChangedEvent, resumeEvent, setApplication, suspendEvent | ||
| 13 | 13 | } from "./application-common"; | |
| 14 | 14 | ||
| 15 | 15 | // First reexport so that app module is initialized. | |
| 16 | 16 | export * from "./application-common"; | |
| 17 | 17 | ||
| 18 | + import { CSS_CLASS_PREFIX, ROOT_VIEW_CSS_CLASSES } from "./application-utils"; | ||
| 19 | + | ||
| 18 | 20 | // TODO: Remove this and get it from global to decouple builder for angular | |
| 19 | 21 | import { createViewFromEntry } from "../ui/builder"; | |
| 20 | 22 | import { ios as iosView, View } from "../ui/core/view"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | // Definitions. | |
| 2 | 2 | import { ViewBase as ViewBaseDefinition } from "."; | |
| 3 | - import { MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "../../../application"; | ||
| 3 | + import { MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "../../../application/application-utils"; | ||
| 4 | 4 | import { | |
| 5 | 5 | AlignSelf, FlexGrow, FlexShrink, FlexWrapBefore, Order | |
| 6 | 6 | } from "../../layouts/flexbox-layout"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ import { | |||
| 9 | 9 | Property, ShowModalOptions, traceCategories, traceEnabled, traceWrite, ViewBase | |
| 10 | 10 | } from "../view-base"; | |
| 11 | 11 | ||
| 12 | - import { MODAL_ROOT_VIEW_CSS_CLASS } from "../../../application"; | ||
| 12 | + import { MODAL_ROOT_VIEW_CSS_CLASS } from "../../../application/application-utils"; | ||
| 13 | 13 | import { HorizontalAlignment, VerticalAlignment, Visibility, Length, PercentLength } from "../../styling/style-properties"; | |
| 14 | 14 | ||
| 15 | 15 | import { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,8 @@ import { Page } from "../page"; | |||
| 7 | 7 | ||
| 8 | 8 | // Types. | |
| 9 | 9 | import * as application from "../../application"; | |
| 10 | + import { CSS_CLASS_PREFIX, ROOT_VIEW_CSS_CLASSES } from "../../application/application-utils"; | ||
| 11 | + | ||
| 10 | 12 | import { | |
| 11 | 13 | _stack, FrameBase, goBack, NavigationType, Observable, | |
| 12 | 14 | traceCategories, traceEnabled, traceError, traceWrite, View | |
@@ -1284,10 +1286,10 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks { | |||
| 1284 | 1286 | activityRootViewsMap.set(rootView._domId, new WeakRef(rootView)); | |
| 1285 | 1287 | ||
| 1286 | 1288 | const deviceType = device.deviceType.toLowerCase(); | |
| 1287 | - application.ROOT_VIEW_CSS_CLASSES.push(`${application.CSS_CLASS_PREFIX}${ANDROID_PLATFORM}`); | ||
| 1288 | - application.ROOT_VIEW_CSS_CLASSES.push(`${application.CSS_CLASS_PREFIX}${deviceType}`); | ||
| 1289 | - application.ROOT_VIEW_CSS_CLASSES.push(`${application.CSS_CLASS_PREFIX}${application.android.orientation}`); | ||
| 1290 | - application.ROOT_VIEW_CSS_CLASSES.forEach(c => this._rootView.cssClasses.add(c)); | ||
| 1289 | + ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${ANDROID_PLATFORM}`); | ||
| 1290 | + ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${deviceType}`); | ||
| 1291 | + ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${application.android.orientation}`); | ||
| 1292 | + ROOT_VIEW_CSS_CLASSES.forEach(c => this._rootView.cssClasses.add(c)); | ||
| 1291 | 1293 | } | |
| 1292 | 1294 | ||
| 1293 | 1295 | // Initialize native visual tree; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments