chg: [js:bootstrap-helper] Improved modalAutoGuess logic

pull/9248/head
Sami Mokaddem 2023-08-11 10:17:08 +02:00
parent bcbf4cbdb7
commit abb5919d31
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 1 deletions

View File

@ -192,7 +192,11 @@ class UIFactory {
* @return {Promise<Object>} Promise object resolving to the ModalFactory object
*/
submissionModalAutoGuess(url, reloadUrl=false, $table=false) {
let currentAction = location.pathname.split('/')[2]
const explodedLocation = location.pathname.split('/').filter((i) => i.length > 0)
let currentAction = explodedLocation[1]
if (explodedLocation.length == 1 && currentAction === undefined) {
currentAction = 'index'
}
if (currentAction !== undefined) {
if (currentAction === 'index') {
return UI.submissionModalForIndex(url, reloadUrl, $table)