Skip to content

Commit 4ceed1a

Browse files
sis0k0hdeshev
authored andcommitted
refactor(renderer): xmlAttributes check
1 parent 955b4d4 commit 4ceed1a

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

Diff for: nativescript-angular/renderer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66

77
import { escapeRegexSymbols } from "tns-core-modules/utils/utils";
88
import { Device } from "tns-core-modules/platform";
9-
import { View } from "ui/core/view";
10-
import { addCss } from "application";
11-
import { topmost } from "ui/frame";
9+
import { View } from "tns-core-modules/ui/core/view";
10+
import { addCss } from "tns-core-modules/application";
11+
import { topmost } from "tns-core-modules/ui/frame";
1212

1313
import { APP_ROOT_VIEW, DEVICE } from "./platform-providers";
1414
import { isBlank } from "./lang-facade";

Diff for: nativescript-angular/view-util.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { rendererLog as traceLog } from "./trace";
1515

1616
const IOS_PREFX: string = ":ios:";
1717
const ANDROID_PREFX: string = ":android:";
18-
const XML_ATTRIBUTES = Object.freeze([ "style", "row", "columns", "fontAttributes"]);
18+
const XML_ATTRIBUTES = Object.freeze(["style", "rows", "columns", "fontAttributes"]);
1919
const whiteSpaceSplitter = /\s+/;
2020

2121
export type ViewExtensions = ViewExtensions;
@@ -146,10 +146,6 @@ export class ViewUtil {
146146
return view;
147147
}
148148

149-
private isXMLAttribute(name: string): boolean {
150-
return XML_ATTRIBUTES.indexOf(name) !== -1;
151-
}
152-
153149
private platformFilter(attribute: string): string {
154150
let lowered = attribute.toLowerCase();
155151
if (lowered.indexOf(IOS_PREFX) === 0) {
@@ -230,7 +226,7 @@ export class ViewUtil {
230226

231227
if (attributeName === "class") {
232228
this.setClasses(view, value);
233-
} else if (this.isXMLAttribute(attributeName)) {
229+
} else if (XML_ATTRIBUTES.indexOf(attributeName) !== -1) {
234230
view._applyXmlAttribute(attributeName, value);
235231
} else if (propMap.has(attributeName)) {
236232
// We have a lower-upper case mapped property.

0 commit comments

Comments
 (0)