diff --git a/src/wagtail_bynder/static/wagtailadmin/js/chooser-modal-handler-factory.js b/src/wagtail_bynder/static/wagtailadmin/js/chooser-modal-handler-factory.js index 78b5ced..a70bbb3 100644 --- a/src/wagtail_bynder/static/wagtailadmin/js/chooser-modal-handler-factory.js +++ b/src/wagtail_bynder/static/wagtailadmin/js/chooser-modal-handler-factory.js @@ -9,6 +9,7 @@ class BynderChooserModalOnloadHandlerFactory { this.assetType = opts?.assetType || null; this.chosenMultipleUrl = opts?.chosenMultipleUrl || "/"; this.chosenSingleUrl = opts?.chosenSingleUrl || "/"; + this.chosenUrlAppendSlash = window.chosenUrlappendSlash || true; } onLoadChooseStep(modal) { @@ -49,6 +50,9 @@ class BynderChooserModalOnloadHandlerFactory { } else { url = chosenSingleUrl + assets[0].databaseId; + if (chosenUrlAppendSlash) { + url += "/"; + } } modal.loadUrl(url, params); return false; diff --git a/src/wagtail_bynder/templates/wagtailadmin/admin_base.html b/src/wagtail_bynder/templates/wagtailadmin/admin_base.html index dca73b6..4035c74 100644 --- a/src/wagtail_bynder/templates/wagtailadmin/admin_base.html +++ b/src/wagtail_bynder/templates/wagtailadmin/admin_base.html @@ -6,6 +6,7 @@