Skip to content

Commit b7ffd36

Browse files
committed
fix(pat schemaeditor): changed autotoc selector
1 parent 5643a5d commit b7ffd36

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/pat/controlpanels/schemaeditor--implementation.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class SchemaEditor {
88
init() {
99
if ($("#form fieldset", this.el).length >= 2) {
1010
// If multiple fieldsets, release after autotoc has been initialized
11-
if ($("#form .autotoc-nav > a", this.el).length) {
11+
if ($("#form .autotoc-nav a", this.el).length) {
1212
// pat-autotoc already initialized, script probably run after
1313
// mockup initialization.
1414
this.init_schemaeditor();
@@ -107,15 +107,15 @@ export default class SchemaEditor {
107107
var self = this;
108108
// ///////////////
109109
// ADD FIELD INIT
110-
$("#form .autotoc-nav > a", this.el).each(function () {
110+
$("#form .autotoc-nav a", this.el).each(function () {
111111
$(this).on("click", function (e) {
112112
e.preventDefault();
113113
var fieldset_id = $(this).attr("data-fieldset_drag_id");
114114
self.init_add_field(fieldset_id);
115115
});
116116
});
117117

118-
var fieldset_id = $("#form .autotoc-nav > a.active", this.el).attr(
118+
var fieldset_id = $("#form .autotoc-nav a.active", this.el).attr(
119119
"data-fieldset_drag_id"
120120
);
121121
this.init_add_field(fieldset_id);
@@ -247,8 +247,7 @@ $.fn.plone_schemaeditor_html5_sortable = function (
247247
}
248248
$(this).attr("data-fieldset_drag_id", i);
249249
});
250-
$("#form .autotoc-nav > a").each(function (i) {
251-
// Plone 5 / mockup
250+
$("#form .autotoc-nav a").each(function (i) {
252251
var $fieldset = $("#form fieldset#fieldset-" + i, self.el);
253252
if ($fieldset.data("can-add-fields") === true) {
254253
$(this).attr("droppable", "true");

0 commit comments

Comments
 (0)