| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,9 @@ import { | |||
| 40 | 40 | LoadAppCSSEventData, | |
| 41 | 41 | UnhandledErrorEventData | |
| 42 | 42 | } from "./application"; | |
| 43 | + | ||
| 43 | 44 | import { DeviceOrientation } from "../ui/enums/enums"; | |
| 45 | + import { CSS_CLASS_PREFIX } from "../ui/utils"; | ||
| 44 | 46 | ||
| 45 | 47 | export { UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData }; | |
| 46 | 48 | ||
@@ -54,13 +56,6 @@ export const uncaughtErrorEvent = "uncaughtError"; | |||
| 54 | 56 | export const discardedErrorEvent = "discardedError"; | |
| 55 | 57 | export const orientationChangedEvent = "orientationChanged"; | |
| 56 | 58 | ||
| 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 | 59 | const ORIENTATION_CSS_CLASSES = [ | |
| 65 | 60 | `${CSS_CLASS_PREFIX}${DeviceOrientation.portrait}`, | |
| 66 | 61 | `${CSS_CLASS_PREFIX}${DeviceOrientation.landscape}`, | |
| 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,8 +8,8 @@ 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. | |
@@ -19,6 +19,7 @@ export * from "./application-common"; | |||
| 19 | 19 | import { createViewFromEntry } from "../ui/builder"; | |
| 20 | 20 | import { ios as iosView, View } from "../ui/core/view"; | |
| 21 | 21 | import { Frame, NavigationEntry } from "../ui/frame"; | |
| 22 | + import { CSS_CLASS_PREFIX, ROOT_VIEW_CSS_CLASSES } from "../ui/utils"; | ||
| 22 | 23 | import { device } from "../platform/platform"; | |
| 23 | 24 | import { profile } from "../profiling"; | |
| 24 | 25 | import { ios } from "../utils/utils"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,5 @@ | |||
| 1 | 1 | // Definitions. | |
| 2 | 2 | import { ViewBase as ViewBaseDefinition } from "."; | |
| 3 | - import { MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "../../../application"; | ||
| 4 | 3 | import { | |
| 5 | 4 | AlignSelf, FlexGrow, FlexShrink, FlexWrapBefore, Order | |
| 6 | 5 | } from "../../layouts/flexbox-layout"; | |
@@ -13,6 +12,7 @@ import { Binding, BindingOptions, Observable, WrappedValue, PropertyChangeData, | |||
| 13 | 12 | import { isIOS, isAndroid } from "../../../platform"; | |
| 14 | 13 | import { layout } from "../../../utils/utils"; | |
| 15 | 14 | import { Length, paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddingLeftProperty } from "../../styling/style-properties"; | |
| 15 | + import { MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "../../utils"; | ||
| 16 | 16 | ||
| 17 | 17 | // TODO: Remove this import! | |
| 18 | 18 | import * as types from "../../../utils/types"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,6 @@ 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"; | ||
| 13 | 12 | import { HorizontalAlignment, VerticalAlignment, Visibility, Length, PercentLength } from "../../styling/style-properties"; | |
| 14 | 13 | ||
| 15 | 14 | import { | |
@@ -25,6 +24,7 @@ import { sanitizeModuleName } from "../../builder/module-name-sanitizer"; | |||
| 25 | 24 | import { StyleScope } from "../../styling/style-scope"; | |
| 26 | 25 | import { LinearGradient } from "../../styling/linear-gradient"; | |
| 27 | 26 | import { BackgroundRepeat } from "../../styling/style-properties"; | |
| 27 | + import { MODAL_ROOT_VIEW_CSS_CLASS } from "../../utils"; | ||
| 28 | 28 | ||
| 29 | 29 | export * from "../../styling/style-properties"; | |
| 30 | 30 | export * from "../view-base"; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ import { Page } from "../page"; | |||
| 7 | 7 | ||
| 8 | 8 | // Types. | |
| 9 | 9 | import * as application from "../../application"; | |
| 10 | + | ||
| 10 | 11 | import { | |
| 11 | 12 | _stack, FrameBase, goBack, NavigationType, Observable, | |
| 12 | 13 | traceCategories, traceEnabled, traceError, traceWrite, View | |
@@ -19,6 +20,7 @@ import { | |||
| 19 | 20 | ||
| 20 | 21 | // TODO: Remove this and get it from global to decouple builder for angular | |
| 21 | 22 | import { createViewFromEntry } from "../builder"; | |
| 23 | + import { CSS_CLASS_PREFIX, ROOT_VIEW_CSS_CLASSES } from "../utils"; | ||
| 22 | 24 | import { device } from "../../platform/platform"; | |
| 23 | 25 | import { profile } from "../../profiling"; | |
| 24 | 26 | ||
@@ -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; | |
| 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 | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | - export module ios { | ||
| 1 | + export { CSS_CLASS_PREFIX, MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "./utils-common"; | ||
| 2 | + | ||
| 3 | + export module ios { | ||
| 2 | 4 | export function getActualHeight(view: any): number { | |
| 3 | 5 | throw new Error("Not implemented for Android"); | |
| 4 | 6 | } | |
@@ -10,4 +12,4 @@ | |||
| 10 | 12 | export function _layoutRootView(rootView: any, parentBounds: any) { | |
| 11 | 13 | throw new Error("Not implemented for Android"); | |
| 12 | 14 | } | |
| 13 | - } | ||
| 15 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,26 @@ | |||
| 3 | 3 | */ | |
| 4 | 4 | ||
| 5 | 5 | import { View } from "./core/view"; | |
| 6 | + | ||
| 7 | + /** | ||
| 8 | + * String value "ns-" used for CSS class prefix. | ||
| 9 | + */ | ||
| 10 | + export const CSS_CLASS_PREFIX: string; | ||
| 11 | + | ||
| 12 | + /** | ||
| 13 | + * String value "ns-modal" used for default CSS class of a modal root view. | ||
| 14 | + */ | ||
| 15 | + export const MODAL_ROOT_VIEW_CSS_CLASS: string; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * Array of string values used for CSS classes of a root view. | ||
| 19 | + * Default value - "ns-root". | ||
| 20 | + * Platform values: "ns-android" and "ns-ios". | ||
| 21 | + * Device type values: "ns-phone" and "ns-tablet". | ||
| 22 | + * Orientation values: "ns-portrait", "ns-landscape" and "ns-unknown". | ||
| 23 | + */ | ||
| 24 | + export const ROOT_VIEW_CSS_CLASSES: string[]; | ||
| 25 | + | ||
| 6 | 26 | export module ios { | |
| 7 | 27 | /** | |
| 8 | 28 | * Gets actual height of a [UIView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/) widget in device pixels. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | - import * as utils from "../utils/utils"; | ||
| 1 | + export { CSS_CLASS_PREFIX, MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "./utils-common"; | ||
| 2 | + | ||
| 3 | + import * as utils from "../utils/utils"; | ||
| 2 | 4 | ||
| 3 | 5 | export module ios { | |
| 4 | 6 | export function getActualHeight(view: UIView): number { | |
@@ -24,4 +26,4 @@ export module ios { | |||
| 24 | 26 | ||
| 25 | 27 | return utils.layout.toDevicePixels(min); | |
| 26 | 28 | } | |
| 27 | - } | ||
| 29 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments