Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix uneccessary confirmation dialog when reopenning a form #3690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions app/qml/form/MMFormStackController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Item {

/*
* MMFormsStackManager component is responsible for viewing feature forms, both preview and fullscreen form
* It contains a stackview where instances of FormWrapper are pushed. Latest form is not destroyed, but reused
* for next feature to reduce a cost of initializing form and AttributeController each time user selects feature.
*/
* It contains a stackview where instances of FormWrapper are pushed.
*/

property var project

Expand Down Expand Up @@ -113,8 +112,7 @@ Item {

function closeAll() {
// close permanetly all drawers (not only hide)
let form = formsStack.get( 0 )
formsStack.pop( form )
formsStack.clear()
}

function reopenAll() {
Expand Down Expand Up @@ -257,11 +255,16 @@ Item {
id: formsStack

function popOneOrClose() {
formsStack.pop()
if ( formsStack.depth > 1 ) {
formsStack.pop()
}
else{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else{
else {

formsStack.clear()
}

if ( formsStack.depth <= 1 )
if ( formsStack.depth === 0 )
{
root.closed() // this is the top most form, we want to keep it instantiated, just invisible
root.closed()
}
}

Expand Down
Loading