mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: update tslint rules (#7391)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import {
|
||||
write as traceWrite, categories as traceCategories, messageType as traceMessageType
|
||||
} from "../trace";
|
||||
|
||||
@@ -40,6 +40,7 @@ export module layout {
|
||||
|
||||
nativeSize.width = layoutCommon.round(toDevicePixels(nativeSize.width));
|
||||
nativeSize.height = layoutCommon.round(toDevicePixels(nativeSize.height));
|
||||
|
||||
return nativeSize;
|
||||
}
|
||||
}
|
||||
@@ -81,6 +82,7 @@ export module ios {
|
||||
const device = UIDevice.currentDevice;
|
||||
const statusBarOrientation = UIApplication.sharedApplication.statusBarOrientation;
|
||||
const isStatusBarOrientationLandscape = isOrientationLandscape(statusBarOrientation);
|
||||
|
||||
return isOrientationLandscape(device.orientation) || isStatusBarOrientationLandscape;
|
||||
}
|
||||
|
||||
@@ -89,15 +91,17 @@ export module ios {
|
||||
export function openFile(filePath: string): boolean {
|
||||
try {
|
||||
const appPath = getCurrentAppPath();
|
||||
const path = filePath.replace("~", appPath)
|
||||
const path = filePath.replace("~", appPath);
|
||||
|
||||
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
|
||||
controller.delegate = new UIDocumentInteractionControllerDelegateImpl();
|
||||
|
||||
return controller.presentPreviewAnimated(true);
|
||||
}
|
||||
catch (e) {
|
||||
traceWrite("Error in openFile", traceCategories.Error, traceMessageType.error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -161,6 +165,7 @@ export function openUrl(location: string): boolean {
|
||||
// We Don't do anything with an error. We just output it
|
||||
traceWrite("Error in OpenURL", traceCategories.Error, traceMessageType.error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -169,6 +174,7 @@ class UIDocumentInteractionControllerDelegateImpl extends NSObject implements UI
|
||||
|
||||
public getViewController(): UIViewController {
|
||||
const app = UIApplication.sharedApplication;
|
||||
|
||||
return app.keyWindow.rootViewController;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user