Skip to content
Snippets Groups Projects
Commit f34f5a77 authored by Prince Gupta's avatar Prince Gupta :speech_balloon: Committed by Rémi Denis-Courmont
Browse files

qml: fix network addressbar home button

Widgets.PageLoader/StackViewExt: load default page if viewProperties is empty

fixup 9457692d
parent 5f20a2b4
No related branches found
No related tags found
1 merge request!1689qml: fix network addressbar home button
Pipeline #206974 passed with stage
in 21 minutes and 51 seconds
......@@ -36,6 +36,12 @@ FocusScope {
loadView()
}
// loads the 'defaultPage'
// this will also apend History.current with the 'defaultPage' entry
function loadDefaultView() {
view = null
}
function loadView() {
if (view === null) {
var defaultView = {"name": defaultPage, "properties": {}}
......
......@@ -62,9 +62,13 @@ StackView {
root.currentItem.dismiss()
if (view === _currentView) {
for ( var viewProp in viewProperties ) {
if ( root.currentItem.hasOwnProperty(viewProp) ) {
root.currentItem[viewProp] = viewProperties[viewProp]
if (Object.keys(viewProperties).length === 0 && root.currentItem.hasOwnProperty("loadDefaultView") ) {
root.currentItem.loadDefaultView()
} else {
for ( var viewProp in viewProperties ) {
if ( root.currentItem.hasOwnProperty(viewProp) ) {
root.currentItem[viewProp] = viewProperties[viewProp]
}
}
}
return true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment