Back button works

This commit is contained in:
Elisa Lupin-Jimenez 2017-08-10 17:51:19 -07:00
parent da5bb03187
commit 6c2bf63392
4 changed files with 9 additions and 1 deletions

View file

@ -24,6 +24,7 @@ Item {
property alias webView: webview
property alias profile: webview.profile
property bool remove: false
property bool closeButtonVisible: true
// Manage own browse history because WebEngineView history is wiped when a new URL is loaded via
// onNewViewRequested, e.g., as happens when a social media share button is clicked.
@ -64,6 +65,7 @@ Item {
disabledColor: hifi.colors.lightGrayText
enabled: true
text: "CLOSE"
visible: closeButtonVisible
MouseArea {
anchors.fill: parent

View file

@ -126,6 +126,9 @@ Item {
loader.item.url = url;
loader.item.scriptURL = injectedJavaScriptUrl;
tabletApps.append({"appUrl": "TabletWebView.qml", "isWebUrl": true, "scriptUrl": injectedJavaScriptUrl, "appWebUrl": url});
if (loader.item.hasOwnProperty("closeButtonVisible")) {
loader.item.closeButtonVisible = false;
}
}
// used to send a message from qml to interface script.

View file

@ -50,6 +50,9 @@ Windows.ScrollingWindow {
function loadWebUrl(url, injectedJavaScriptUrl) {
loader.item.url = url;
loader.item.scriptURL = injectedJavaScriptUrl;
if (loader.item.hasOwnProperty("closeButtonVisible")) {
loader.item.closeButtonVisible = false;
}
}
// used to send a message from qml to interface script.

View file

@ -606,7 +606,7 @@ void TabletProxy::loadWebScreenOnTop(const QVariant& url, const QString& injectJ
void TabletProxy::gotoWebScreen(const QString& url, const QString& injectedJavaScriptUrl, bool loadOtherBase) {
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(this, "gotoWebScreen", Q_ARG(QString, url), Q_ARG(QString, injectedJavaScriptUrl));
QMetaObject::invokeMethod(this, "gotoWebScreen", Q_ARG(QString, url), Q_ARG(QString, injectedJavaScriptUrl), Q_ARG(bool, loadOtherBase));
return;
}