Skip to content

Commit

Permalink
fix: #9065, settings v2/v3 conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Dec 5, 2020
1 parent 970ccb5 commit 91c20ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions public/src/admin/settings/api.js
Expand Up @@ -4,9 +4,7 @@ define('admin/settings/api', ['settings'], function (settings) {
var ACP = {};

ACP.init = function () {
const saveEl = $('#save');
settings.load('core.api', $('.core-api-settings'));
saveEl.off('click'); // override settingsv1 handling
$('#save').on('click', saveSettings);

$(window).on('action:settings.sorted-list.loaded', (ev, { element }) => {
Expand Down
6 changes: 3 additions & 3 deletions src/views/admin/settings/api.tpl
@@ -1,5 +1,3 @@
<!-- IMPORT admin/partials/settings/header.tpl -->

<form role="form" class="core-api-settings">
<p class="lead">[[admin/settings/api:lead-text]]</p>
<p>[[admin/settings/api:intro]]</p>
Expand Down Expand Up @@ -37,4 +35,6 @@
</div>
</form>

<!-- IMPORT admin/partials/settings/footer.tpl -->
<button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
<i class="material-icons">save</i>
</button>

2 comments on commit 91c20ce

@julianlam
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't we lose the table of contents this way?

Not a big deal, but something to consider

@barisusakli
Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah there aren't a lot of settings on that page so not a big deal.

Issue is if you import admin/partials/settings/footer.tpl it initializes the settings api breaking the settings save on this page.

saveEl.off('click'); // override settingsv1 handling
this was firing before the footer initializes the settings.

Please sign in to comment.