FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor: rename property · NativeScript/NativeScript@f9edb1b · GitHub

Commit f9edb1b

Browse files
committed
refactor: rename property
1 parent 3891f9c commit f9edb1b

7 files changed

Lines changed: 12 additions & 18 deletions

File tree

‎tests/app/livesync/livesync-tests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function _test_onLiveSync_ModuleContext_TypeStyle(context: { type, path }) {
120120
helper.navigateWithHistory(() => page);
121121

122122
const pageBeforeLiveSync = helper.getCurrentPage();
123-
pageBeforeLiveSync._rootOfModule = "main-page";
123+
pageBeforeLiveSync._moduleName = "main-page";
124124
global.__onLiveSync({ type: context.type, path: context.path });
125125

126126
const pageAfterLiveSync = helper.getCurrentPage();

‎tests/app/ui/builder/builder-tests.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ function getViewComponent() {
1414

1515
export function test_view_is_module_root_component() {
1616
const view = getViewComponent();
17-
const actualModule = view._rootOfModule;
17+
const actualModule = view._moduleName;
1818
assertEqual(actualModule, COMPONENT_MODULE, `View<${view}> is NOT root component of module <${COMPONENT_MODULE}>.`);
1919
}
2020

2121
export function test_view_is_NOT_module_root_component() {
2222
const view = getViewComponent();
2323
const nestedView = view.getViewById(`${LABEL}`);
24-
const undefinedModule = nestedView._rootOfModule;
24+
const undefinedModule = nestedView._moduleName;
2525
assertNull(undefinedModule, `View<${nestedView}> should NOT be a root component of a module.`);
2626
}

‎tns-core-modules/ui/builder/builder.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function load(pathOrOptions: string | LoadOptions, context?: any): View {
6060
export function loadPage(moduleNamePath: string, fileName: string, context?: any): View {
6161
const componentModule = loadInternal(fileName, context, moduleNamePath);
6262
const componentView = componentModule && componentModule.component;
63-
setRootOfModule(componentView, moduleNamePath);
63+
markAsModuleRoot(componentView, moduleNamePath);
6464
return componentView;
6565
}
6666

@@ -138,10 +138,10 @@ const moduleCreateView = profile("module.createView", (moduleNamePath: string, m
138138
return view;
139139
});
140140

141-
function setRootOfModule(componentView: View, moduleNamePath: string): void {
141+
function markAsModuleRoot(componentView: View, moduleNamePath: string): void {
142142
const lastIndexOfSeparator = moduleNamePath.lastIndexOf(path.separator);
143143
const moduleName = moduleNamePath.substring(lastIndexOfSeparator + 1);
144-
componentView._rootOfModule = moduleName;
144+
componentView._moduleName = moduleName;
145145
}
146146

147147
function loadInternal(fileName: string, context?: any, moduleNamePath?: string): ComponentModule {

‎tns-core-modules/ui/core/view-base/view-base.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export abstract class ViewBase extends Observable {
112112
* @private
113113
* Module name when the view is a module root. Otherwise, it is undefined.
114114
*/
115-
_rootOfModule?: string;
115+
_moduleName?: string;
116116

117117
//@private
118118
/**

‎tns-core-modules/ui/core/view-base/view-base.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
244244
public _defaultPaddingLeft: number;
245245
public _isPaddingRelative: boolean;
246246

247-
public _rootOfModule: string;
247+
public _moduleName: string;
248248

249249
constructor() {
250250
super();

‎tns-core-modules/ui/core/view/view-common.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import {
55
} from ".";
66

77
import {
8-
ViewBase, Property, booleanConverter, EventData, layout,
8+
ViewBase, Property, booleanConverter, eachDescendant, EventData, layout,
99
getEventOrGestureName, traceEnabled, traceWrite, traceCategories,
1010
InheritedProperty,
11-
ShowModalOptions,
12-
eachDescendant
11+
ShowModalOptions
1312
} from "../view-base";
1413

1514
import { HorizontalAlignment, VerticalAlignment, Visibility, Length, PercentLength } from "../../styling/style-properties";
@@ -156,11 +155,12 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
156155
return true;
157156
});
158157
}
158+
// Do not execute frame navigation for a change in styles
159159
return true;
160160
}
161161

162162
private changeStyles(view: ViewBase, contextPath: string): boolean {
163-
if (view._rootOfModule && contextPath.includes(view._rootOfModule)) {
163+
if (view._moduleName && contextPath.includes(view._moduleName)) {
164164
(<this>view).changeCssFile(contextPath);
165165
return true;
166166
}

‎tns-core-modules/ui/core/view/view.d.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,12 +720,6 @@ export abstract class View extends ViewBase {
720720
* __Obsolete:__ There is a new property system that does not rely on _setValue.
721721
*/
722722
_setValue(property: any, value: any): never;
723-
724-
/**
725-
* @private
726-
* Module name in case the view is a root. Otherwise, it is undefined.
727-
*/
728-
_rootOfModule?: string;
729723
}
730724

731725
/**

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL