mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(style-scope): remove isFileOrResourcePath check
This commit is contained in:
@@ -4,17 +4,16 @@ import cssSelector = require("ui/styling/css-selector");
|
|||||||
import cssParser = require("css");
|
import cssParser = require("css");
|
||||||
import application = require("application");
|
import application = require("application");
|
||||||
import * as typesModule from "utils/types";
|
import * as typesModule from "utils/types";
|
||||||
import * as utilsModule from "utils/utils";
|
|
||||||
import * as fileSystemModule from "file-system";
|
import * as fileSystemModule from "file-system";
|
||||||
|
|
||||||
import keyframeAnimation = require("ui/animation/keyframe-animation");
|
import keyframeAnimation = require("ui/animation/keyframe-animation");
|
||||||
import cssAnimationParser = require("./css-animation-parser");
|
import cssAnimationParser = require("./css-animation-parser");
|
||||||
import observable = require("ui/core/dependency-observable");
|
import observable = require("ui/core/dependency-observable");
|
||||||
|
|
||||||
import {convertString} from "utils/utils";
|
import { convertString } from "utils/utils";
|
||||||
import {RuleSet, Node, SelectorsMap, SelectorCore, SelectorsMatch, ChangeMap } from "ui/styling/css-selector";
|
import { RuleSet, Node, SelectorsMap, SelectorCore, SelectorsMatch, ChangeMap } from "ui/styling/css-selector";
|
||||||
import {StyleProperty, withStyleProperty} from "ui/styling/style-property";
|
import { StyleProperty, withStyleProperty } from "ui/styling/style-property";
|
||||||
import {getSpecialPropertySetter} from "ui/builder/special-properties";
|
import { getSpecialPropertySetter } from "ui/builder/special-properties";
|
||||||
|
|
||||||
const animationsSymbol: symbol = Symbol("animations");
|
const animationsSymbol: symbol = Symbol("animations");
|
||||||
|
|
||||||
@@ -25,13 +24,6 @@ function ensureTypes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var utils: typeof utilsModule;
|
|
||||||
function ensureUtils() {
|
|
||||||
if (!utils) {
|
|
||||||
utils = require("utils/utils");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var fs: typeof fileSystemModule;
|
var fs: typeof fileSystemModule;
|
||||||
function ensureFS() {
|
function ensureFS() {
|
||||||
if (!fs) {
|
if (!fs) {
|
||||||
@@ -144,20 +136,16 @@ export class StyleScope {
|
|||||||
let url = match && match[2];
|
let url = match && match[2];
|
||||||
|
|
||||||
if (!types.isNullOrUndefined(url)) {
|
if (!types.isNullOrUndefined(url)) {
|
||||||
ensureUtils();
|
ensureFS();
|
||||||
|
|
||||||
if (utils.isFileOrResourcePath(url)) {
|
let appDirectory = fs.knownFolders.currentApp().path;
|
||||||
ensureFS();
|
let fileName = resolveFileNameFromUrl(url, appDirectory, fs.File.exists);
|
||||||
|
|
||||||
let appDirectory = fs.knownFolders.currentApp().path;
|
if (fileName !== null) {
|
||||||
let fileName = resolveFileNameFromUrl(url, appDirectory, fs.File.exists);
|
let file: fileSystemModule.File = fs.File.fromPath(fileName);
|
||||||
|
let text = file.readTextSync();
|
||||||
if (fileName !== null) {
|
if (text) {
|
||||||
let file: fileSystemModule.File = fs.File.fromPath(fileName);
|
selectors = selectors.concat(StyleScope.createSelectorsFromCss(text, fileName, keyframes));
|
||||||
let text = file.readTextSync();
|
|
||||||
if (text) {
|
|
||||||
selectors = selectors.concat(StyleScope.createSelectorsFromCss(text, fileName, keyframes));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user