mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix: cleanup modaltest paths (#5300)
This commit is contained in:

committed by
GitHub

parent
87703ce3ea
commit
8d59cc4de6
@ -1,11 +1,11 @@
|
|||||||
import * as application from "tns-core-modules/application";
|
import * as application from "tns-core-modules/application";
|
||||||
// trace.addCategories(trace.categories.All);
|
// trace.addCategories(trace.categories.All);
|
||||||
// application.run({ moduleName: "page.1" });
|
// application.run({ moduleName: "modaltest/page.1" });
|
||||||
// application.run({ moduleName: "main-page" });
|
// application.run({ moduleName: "modaltest/main-page" });
|
||||||
|
|
||||||
application.run({ moduleName: "modal-tab" });
|
application.run({ moduleName: "modaltest/modal-tab" });
|
||||||
// application.run({ moduleName: "textview" });
|
// application.run({ moduleName: "modaltest/textview" });
|
||||||
|
|
||||||
// application.start({ moduleName: "modal-tab.33" });
|
// application.start({ moduleName: "modaltest/modal-tab.33" });
|
||||||
// application.run({ moduleName: "modal-frame" });
|
// application.run({ moduleName: modaltest/modal-frame" });
|
||||||
// application.start({ moduleName: "page.2" });
|
// application.start({ moduleName: "modaltest/page.2" });
|
@ -7,17 +7,17 @@ export function onNavigatingTo(args: EventData) {
|
|||||||
|
|
||||||
export function navigate(args: EventData) {
|
export function navigate(args: EventData) {
|
||||||
console.log("navigate");
|
console.log("navigate");
|
||||||
(args.object as View).page.frame.navigate("page.1");
|
(args.object as View).page.frame.navigate("modaltest/page.1");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onModalTab(args: EventData) {
|
export function onModalTab(args: EventData) {
|
||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
view.showModal("modal-tab", "context", closeModal, false);
|
view.showModal("modaltest/modal-tab", "context", closeModal, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onModalFrame(args: EventData) {
|
export function onModalFrame(args: EventData) {
|
||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
view.showModal("modal-frame", "context", closeModal, false);
|
view.showModal("modaltest/modal-frame", "context", closeModal, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onTap3(args: EventData) {
|
export function onTap3(args: EventData) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Page backgroundColor="pink" codeFile='~/page.2' actionBarHidden="true">
|
<Page backgroundColor="pink" codeFile='~/modaltest/page.2' actionBarHidden="true">
|
||||||
<Frame>
|
<Frame>
|
||||||
<Page backgroundColor="purple">
|
<Page backgroundColor="purple">
|
||||||
<ActionBar title=" AAA ">
|
<ActionBar title=" AAA ">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Frame codeFile='~/page.2'>
|
<Frame codeFile='~/modaltest/page.2'>
|
||||||
<Page backgroundColor="pink">
|
<Page backgroundColor="pink">
|
||||||
<ActionBar title="{{ $value, 'Page ' + $value }} ">
|
<ActionBar title="{{ $value, 'Page ' + $value }} ">
|
||||||
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<Page backgroundColor="blue" actionBarHidden="true" loaded="pageLoaded"
|
<Page backgroundColor="blue" actionBarHidden="true" loaded="pageLoaded"
|
||||||
codeFile='~/modal-tab'>
|
codeFile='~/modaltest/modal-tab'>
|
||||||
<ActionBar title="Frame in Modal Page">
|
<ActionBar title="Frame in Modal Page">
|
||||||
<ActionItem text="close" tap="closeModal" />
|
<ActionItem text="close" tap="closeModal" />
|
||||||
</ActionBar>
|
</ActionBar>
|
||||||
|
@ -22,7 +22,7 @@ export function onTap(args) {
|
|||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
const page = view.page;
|
const page = view.page;
|
||||||
let context = page.bindingContext || 0;
|
let context = page.bindingContext || 0;
|
||||||
page.frame.navigate({ moduleName: "page.2", bindingContext: ++context, transition: { name: "fade", duration: 1000 } });
|
page.frame.navigate({ moduleName: "modaltest/page.2", bindingContext: ++context, transition: { name: "fade", duration: 1000 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function tenGoBacks(args) {
|
export function tenGoBacks(args) {
|
||||||
@ -33,7 +33,7 @@ export function tenGoBacks(args) {
|
|||||||
let context = page.bindingContext || 0;
|
let context = page.bindingContext || 0;
|
||||||
let x = 4;
|
let x = 4;
|
||||||
while (x--) {
|
while (x--) {
|
||||||
frame.navigate({ moduleName: "page.2", bindingContext: ++context, transition: { name: "fade", duration: 1000 } });
|
frame.navigate({ moduleName: "modaltest/page.2", bindingContext: ++context, transition: { name: "fade", duration: 1000 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
x = 4;
|
x = 4;
|
||||||
@ -50,17 +50,17 @@ export function navigateToFrame(args: EventData) {
|
|||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
const page = view.page;
|
const page = view.page;
|
||||||
const frame = page.frame;
|
const frame = page.frame;
|
||||||
frame.navigate("modal-frame");
|
frame.navigate("modaltest/modal-frame");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function navigateToPageWithFrame(args: EventData) {
|
export function navigateToPageWithFrame(args: EventData) {
|
||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
const page = view.page;
|
const page = view.page;
|
||||||
const frame = page.frame;
|
const frame = page.frame;
|
||||||
frame.navigate("modal-frame.1");
|
frame.navigate("modaltest/modal-frame.1");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onModalFrame(args: EventData) {
|
export function onModalFrame(args: EventData) {
|
||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
view.showModal("modal-frame", "some context", closeModal, false);
|
view.showModal("modaltest/modal-frame", "some context", undefined, false);
|
||||||
}
|
}
|
@ -17,7 +17,7 @@ export function onTap(args: EventData) {
|
|||||||
const view = args.object as View;
|
const view = args.object as View;
|
||||||
const page = view.page;
|
const page = view.page;
|
||||||
let context = page.bindingContext || 0;
|
let context = page.bindingContext || 0;
|
||||||
page.frame.navigate({ moduleName: "page.2", bindingContext: ++context, transition: { name: "fade", duration: 1000 } });
|
page.frame.navigate({ moduleName: "modaltest/page.2", bindingContext: ++context, transition: { name: "fade", duration: 1000 } });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onBack(args: EventData) {
|
export function onBack(args: EventData) {
|
||||||
@ -32,7 +32,7 @@ export function closeModal(args: EventData) {
|
|||||||
|
|
||||||
let modalContext = 0;
|
let modalContext = 0;
|
||||||
export function showModal(args: EventData) {
|
export function showModal(args: EventData) {
|
||||||
(args.object as View).showModal("page.2", ++modalContext, function () {
|
(args.object as View).showModal("modaltest/page.2", ++modalContext, function () {
|
||||||
console.log("Closed Modal: " + (args.object as View).bindingContext);
|
console.log("Closed Modal: " + (args.object as View).bindingContext);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<Page backgroundColor="pink" showingModally="showingModally">
|
<Page backgroundColor="pink" showingModally="showingModally">
|
||||||
<ActionBar title="{{ $value }} ">
|
<ActionBar title="{{ $value + ' page' }} ">
|
||||||
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
<ActionItem text="close" tap="closeModal" ios.position='right' />
|
||||||
</ActionBar>
|
</ActionBar>
|
||||||
<StackLayout backgroundColor="orange">
|
<StackLayout backgroundColor="orange">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "tns-samples-apps",
|
"name": "tns-samples-apps",
|
||||||
"main": "ui-tests-app/app.js"
|
"main": "modaltest/app.js"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user