impl pop to root
This commit is contained in:
parent
ab0ab98aaa
commit
dbbc7db31a
@ -175,4 +175,16 @@ ApplicationWindow {
|
|||||||
navbar.visible = false
|
navbar.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function navigatorPopToRoot() {
|
||||||
|
while (stack.depth > 1) {
|
||||||
|
stack.pop()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.depth > 1) {
|
||||||
|
navbar.visible = true
|
||||||
|
} else {
|
||||||
|
navbar.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,20 @@ void DoricNavigatorPlugin::popSelf(QString jsValueString, QString callbackId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DoricNavigatorPlugin::popToRoot(QString jsValueString,
|
void DoricNavigatorPlugin::popToRoot(QString jsValueString,
|
||||||
QString callbackId) {}
|
QString callbackId) {
|
||||||
|
getContext()->getDriver()->asyncCall(
|
||||||
|
[this] {
|
||||||
|
QObject *window = getContext()->getQmlEngine()->rootObjects().at(0);
|
||||||
|
QMetaObject::invokeMethod(window, "navigatorPopToRoot");
|
||||||
|
},
|
||||||
|
DoricThreadMode::UI);
|
||||||
|
|
||||||
|
getContext()->getDriver()->asyncCall(
|
||||||
|
[this, callbackId] {
|
||||||
|
QVariantList args;
|
||||||
|
DoricPromise::resolve(getContext(), callbackId, args);
|
||||||
|
},
|
||||||
|
DoricThreadMode::JS);
|
||||||
|
}
|
||||||
|
|
||||||
void DoricNavigatorPlugin::openUrl(QString jsValueString, QString callbackId) {}
|
void DoricNavigatorPlugin::openUrl(QString jsValueString, QString callbackId) {}
|
||||||
|
Reference in New Issue
Block a user