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

🐛 Fix: 'cancel' button redirects to console instead of portal #387

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -426,12 +426,24 @@ $(function()
}
else
{
// Try to close the window
window.close();

if(window.history.length == 1) {

jbostoen marked this conversation as resolved.
Show resolved Hide resolved
// Not a modal, but there is no other history.
// Try to close the window.
window.close();

// In some browser (eg. Firefox 70), window won't close if it has NOT been open by JS. In that case, we try to redirect to homepage as a fallback.
var sHomepageUrl = (this.options.base_url !== null) ? this.options.base_url : $('#sidebar .menu .brick_menu_item:first a').attr('href')
window.location.href = sHomepageUrl;
// In some browser (eg. Firefox 70), window won't close if it has NOT been open by JS. In that case, we try to redirect to homepage as a fallback.
var sHomepageUrl = (this.options.base_url !== null) ? this.options.base_url : $('#sidebar .menu .brick_menu_item:first a').attr('href')
window.location.href = sHomepageUrl;

}
else {

Molkobain marked this conversation as resolved.
Show resolved Hide resolved
window.history.back(-1);

jbostoen marked this conversation as resolved.
Show resolved Hide resolved
}

}
},
submit: function(oEvent)
Expand Down
Expand Up @@ -76,7 +76,7 @@
field_set: oFieldSet_{{ sFormIdSanitized }},
submit_btn_selector: $('#{{ sFormId }}').parent().find('.form_btn_submit, .form_btn_transition'),
cancel_btn_selector: $('#{{ sFormId }}').parent().find('.form_btn_cancel'),
base_url: "{{ app['combodo.absolute_url'] }}",
base_url: "{{ app['combodo.portal.base.absolute_url'] }}",
{% if form.submit_rule is not null %}submit_rule: {{ form.submit_rule|json_encode|raw }}{% endif %},
{% if form.cancel_rule is not null %}cancel_rule: {{ form.cancel_rule|json_encode|raw }}{% endif %},
endpoint: "{{ form.renderer.GetEndpoint()|raw }}",
Expand Down