mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
layouts handled automatically as well
This commit is contained in:
@ -14,11 +14,6 @@ import platform = require("platform");
|
|||||||
var EVENT = "Event";
|
var EVENT = "Event";
|
||||||
var UI_PATH = "ui/";
|
var UI_PATH = "ui/";
|
||||||
var MODULES = {
|
var MODULES = {
|
||||||
"GridLayout": "ui/layouts/grid-layout",
|
|
||||||
"DockLayout": "ui/layouts/dock-layout",
|
|
||||||
"WrapLayout": "ui/layouts/wrap-layout",
|
|
||||||
"AbsoluteLayout": "ui/layouts/absolute-layout",
|
|
||||||
"StackLayout": "ui/layouts/stack-layout",
|
|
||||||
"TabViewItem": "ui/tab-view",
|
"TabViewItem": "ui/tab-view",
|
||||||
"FormattedString": "text/formatted-string",
|
"FormattedString": "text/formatted-string",
|
||||||
"Span": "text/span",
|
"Span": "text/span",
|
||||||
@ -41,7 +36,9 @@ export function getComponentModule(elementName: string, namespace: string, attri
|
|||||||
var componentModule: definition.ComponentModule;
|
var componentModule: definition.ComponentModule;
|
||||||
|
|
||||||
// Get module id.
|
// Get module id.
|
||||||
var moduleId = MODULES[elementName] || UI_PATH + elementName.split(/(?=[A-Z])/).join("-").toLowerCase();
|
var moduleId = MODULES[elementName] || UI_PATH +
|
||||||
|
(elementName.toLowerCase().indexOf("layout") !== -1 ? "layouts/" : "") +
|
||||||
|
elementName.split(/(?=[A-Z])/).join("-").toLowerCase();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (types.isString(namespace)) {
|
if (types.isString(namespace)) {
|
||||||
|
Reference in New Issue
Block a user