diff --git a/CHANGELOG.md b/CHANGELOG.md
index 931bc86f19..7f9d91a1e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,15 @@
Cross Platform Modules Changelog
==============================
+
+# [4.1.1](https://github.com/NativeScript/NativeScript/compare/4.1.0...4.1.1) (2018-07-18)
+
+
+### Bug Fixes
+
+* require devtools-elements.js with the extension mentioned explicitly ([#6079](https://github.com/NativeScript/NativeScript/issues/6079)) ([1a15aa2](https://github.com/NativeScript/NativeScript/commit/1a15aa2))
+
+
# [4.1.0](https://github.com/NativeScript/NativeScript/compare/4.0.1...4.1.0) (2018-05-28)
diff --git a/e2e/modal-navigation/app/home/home-page.ts b/e2e/modal-navigation/app/home/home-page.ts
index f7871e8002..6b8225ceb6 100644
--- a/e2e/modal-navigation/app/home/home-page.ts
+++ b/e2e/modal-navigation/app/home/home-page.ts
@@ -20,6 +20,15 @@ export function onNavigatedFrom(args: NavigatedData) {
console.log("home-page onNavigatedFrom");
}
+export function onModalNoPage(args: EventData) {
+ const view = args.object as View;
+
+ view.showModal("modal-no-page/modal-no-page",
+ "context",
+ () => console.log("home-page modal frame closed"),
+ false);
+}
+
export function onModalFrame(args: EventData) {
const view = args.object as View;
diff --git a/e2e/modal-navigation/app/home/home-page.xml b/e2e/modal-navigation/app/home/home-page.xml
index 805df0ab59..4abbc0488b 100644
--- a/e2e/modal-navigation/app/home/home-page.xml
+++ b/e2e/modal-navigation/app/home/home-page.xml
@@ -10,6 +10,7 @@
+
diff --git a/e2e/modal-navigation/app/layout-root.ios.ts b/e2e/modal-navigation/app/layout-root.ios.ts
index 403480d1ee..2fa6b9ac89 100644
--- a/e2e/modal-navigation/app/layout-root.ios.ts
+++ b/e2e/modal-navigation/app/layout-root.ios.ts
@@ -1,4 +1,5 @@
export {
+ onModalNoPage,
onModalFrame,
onModalPage,
onModalLayout,
diff --git a/e2e/modal-navigation/app/layout-root.ios.xml b/e2e/modal-navigation/app/layout-root.ios.xml
index 40d6d68bd3..eb544ab8fc 100644
--- a/e2e/modal-navigation/app/layout-root.ios.xml
+++ b/e2e/modal-navigation/app/layout-root.ios.xml
@@ -1,5 +1,6 @@
+
diff --git a/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts b/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts
new file mode 100644
index 0000000000..88395c2b74
--- /dev/null
+++ b/e2e/modal-navigation/app/modal-no-page/modal-no-page.ts
@@ -0,0 +1,28 @@
+import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
+import { NavigatedData, Page } from "tns-core-modules/ui/page";
+import { View, EventData } from "tns-core-modules/ui/core/view";
+import { Frame, ShownModallyData } from "tns-core-modules/ui/frame";
+import { fromObject } from "tns-core-modules/data/observable";
+import { confirm } from "ui/dialogs";
+
+export function onLoaded(args) {
+ console.log("modal-no-page loaded");
+}
+
+export function closeModal(args: EventData) {
+ (args.object as View).closeModal();
+}
+
+export function showDialog(args: EventData) {
+ let options = {
+ title: "Dialog",
+ message: "Message",
+ okButtonText: "Yes",
+ cancelButtonText: "No"
+
+ }
+
+ confirm(options).then((result: boolean) => {
+ console.log(result);
+ })
+}
\ No newline at end of file
diff --git a/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml b/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml
new file mode 100644
index 0000000000..dde7de6cb2
--- /dev/null
+++ b/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/e2e/modal-navigation/app/modal/modal-page.ts b/e2e/modal-navigation/app/modal/modal-page.ts
index d35dfdbb4e..c191dfe957 100644
--- a/e2e/modal-navigation/app/modal/modal-page.ts
+++ b/e2e/modal-navigation/app/modal/modal-page.ts
@@ -3,6 +3,7 @@ import { NavigatedData, Page } from "tns-core-modules/ui/page";
import { View, EventData } from "tns-core-modules/ui/core/view";
import { Frame, ShownModallyData } from "tns-core-modules/ui/frame";
import { fromObject } from "tns-core-modules/data/observable";
+import { confirm } from "ui/dialogs";
export function onShowingModally(args: ShownModallyData) {
console.log("modal-page showingModally");
@@ -64,4 +65,18 @@ export function onNavigate(args: EventData) {
const view = args.object as View;
const page = view.page as Page;
page.frame.navigate("modal-second/modal-second-page");
+}
+
+export function showDialog(args: EventData) {
+ let options = {
+ title: "Dialog",
+ message: "Message",
+ okButtonText: "Yes",
+ cancelButtonText: "No"
+
+ }
+
+ confirm(options).then((result: boolean) => {
+ console.log(result);
+ })
}
\ No newline at end of file
diff --git a/e2e/modal-navigation/app/modal/modal-page.xml b/e2e/modal-navigation/app/modal/modal-page.xml
index d5c4941ea5..c7350b4a6a 100644
--- a/e2e/modal-navigation/app/modal/modal-page.xml
+++ b/e2e/modal-navigation/app/modal/modal-page.xml
@@ -10,6 +10,7 @@
+
diff --git a/tns-core-modules/globals/globals.ts b/tns-core-modules/globals/globals.ts
index 5b3162d632..15b61854e3 100644
--- a/tns-core-modules/globals/globals.ts
+++ b/tns-core-modules/globals/globals.ts
@@ -206,7 +206,7 @@ export function Deprecated(target: Object, key?: string | symbol, descriptor?: a
var originalMethod = descriptor.value;
descriptor.value = function (...args: any[]) {
- console.log(`${key} is deprecated`);
+ console.log(`${key.toString()} is deprecated`);
return originalMethod.apply(this, args);
}
@@ -225,7 +225,7 @@ export function Experimental(target: Object, key?: string | symbol, descriptor?:
var originalMethod = descriptor.value;
descriptor.value = function (...args: any[]) {
- console.log(`${key} is experimental`);
+ console.log(`${key.toString()} is experimental`);
return originalMethod.apply(this, args);
}
diff --git a/tns-core-modules/package.json b/tns-core-modules/package.json
index c2376241a8..dbf50de264 100644
--- a/tns-core-modules/package.json
+++ b/tns-core-modules/package.json
@@ -1,7 +1,7 @@
{
"name": "tns-core-modules",
"description": "Telerik NativeScript Core Modules",
- "version": "4.1.0",
+ "version": "4.1.1",
"homepage": "https://www.nativescript.org",
"repository": {
"type": "git",
diff --git a/tns-core-modules/ui/core/view/view.d.ts b/tns-core-modules/ui/core/view/view.d.ts
index bb267f0fa6..f040ce2e67 100644
--- a/tns-core-modules/ui/core/view/view.d.ts
+++ b/tns-core-modules/ui/core/view/view.d.ts
@@ -775,6 +775,7 @@ export const isEnabledProperty: Property;
export const isUserInteractionEnabledProperty: Property;
export namespace ios {
+ export function getParentWithViewController(parent: View): View
export function isContentScrollable(controller: any /* UIViewController */, owner: View): boolean
export function updateAutoAdjustScrollInsets(controller: any /* UIViewController */, owner: View): void
export function updateConstraints(controller: any /* UIViewController */, owner: View): void;
diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts
index fc47597a35..d4b139b7ff 100644
--- a/tns-core-modules/ui/core/view/view.ios.ts
+++ b/tns-core-modules/ui/core/view/view.ios.ts
@@ -308,18 +308,8 @@ export class View extends ViewCommon {
return this._suspendCATransaction || this._suspendNativeUpdatesCount;
}
- private getParentWithViewController(parent: View): View {
- let view = parent;
- let controller = view.viewController;
- while (!controller) {
- view = view.parent as View;
- controller = view.viewController;
- }
-
- return view;
- }
protected _showNativeModalView(parent: View, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean) {
- let parentWithController = this.getParentWithViewController(parent);
+ let parentWithController = ios.getParentWithViewController(parent);
super._showNativeModalView(parentWithController, context, closeCallback, fullscreen, stretched);
let controller = this.viewController;
@@ -592,6 +582,17 @@ export class CustomLayoutView extends View {
}
export namespace ios {
+ export function getParentWithViewController(parent: View): View {
+ let view = parent;
+ let controller = view.viewController;
+ while (!controller) {
+ view = view.parent as View;
+ controller = view.viewController;
+ }
+
+ return view;
+ }
+
export function isContentScrollable(controller: UIViewController, owner: View): boolean {
let scrollableContent = (owner).scrollableContent;
if (scrollableContent === undefined) {
diff --git a/tns-core-modules/ui/dialogs/dialogs.ios.ts b/tns-core-modules/ui/dialogs/dialogs.ios.ts
index a38ee792ea..cb4da410ca 100644
--- a/tns-core-modules/ui/dialogs/dialogs.ios.ts
+++ b/tns-core-modules/ui/dialogs/dialogs.ios.ts
@@ -1,7 +1,7 @@
/**
* iOS specific dialogs functions implementation.
*/
-
+import { View, ios as iosView } from "../core/view";
import { ConfirmOptions, PromptOptions, PromptResult, LoginOptions, LoginResult, ActionOptions } from ".";
import { getCurrentPage, getLabelColor, getButtonColors, getTextFieldColor, isDialogOptions, inputType, ALERT, OK, CONFIRM, CANCEL, PROMPT, LOGIN } from "./dialogs-common";
import { isString, isDefined, isFunction } from "../../utils/types";
@@ -42,7 +42,7 @@ export function alert(arg: any): Promise {
try {
let options = !isDialogOptions(arg) ? { title: ALERT, okButtonText: OK, message: arg + "" } : arg;
let alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);
-
+
addButtonsToAlertController(alertController, options, () => { resolve(); });
showUIAlertController(alertController);
@@ -157,7 +157,7 @@ export function login(): Promise {
let alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);
let textFieldColor = getTextFieldColor();
-
+
alertController.addTextFieldWithConfigurationHandler((arg: UITextField) => {
arg.placeholder = "Login";
arg.text = isString(options.userName) ? options.userName : "";
@@ -185,7 +185,7 @@ export function login(): Promise {
resolve({
result: r,
userName:
- userNameTextField.text,
+ userNameTextField.text,
password: passwordTextField.text
});
});
@@ -200,7 +200,19 @@ export function login(): Promise {
function showUIAlertController(alertController: UIAlertController) {
let currentPage = getCurrentPage();
if (currentPage) {
- let viewController: UIViewController = currentPage.modal ? currentPage.modal.ios : currentPage.ios;
+ let view: View = currentPage;
+ let viewController: UIViewController = currentPage.ios;
+
+ if (currentPage.modal) {
+ view = currentPage.modal;
+
+ if (view.ios instanceof UIViewController) {
+ viewController = view.ios;
+ } else {
+ viewController = iosView.getParentWithViewController(view).viewController;
+ }
+ }
+
if (viewController) {
if (alertController.popoverPresentationController) {
alertController.popoverPresentationController.sourceView = viewController.view;
diff --git a/tns-core-modules/ui/frame/frame.android.ts b/tns-core-modules/ui/frame/frame.android.ts
index 8f4c2f51f1..9758e97b1d 100644
--- a/tns-core-modules/ui/frame/frame.android.ts
+++ b/tns-core-modules/ui/frame/frame.android.ts
@@ -42,7 +42,7 @@ let fragmentId = -1;
export let moduleLoaded: boolean;
if (global && global.__inspector) {
- const devtools = require("tns-core-modules/debugger/devtools-elements");
+ const devtools = require("tns-core-modules/debugger/devtools-elements.js");
devtools.attachDOMInspectorEventCallbacks(global.__inspector);
devtools.attachDOMInspectorCommandCallbacks(global.__inspector);
}