@themarioga/grid-editor 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +45 -4
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.css +73 -11
- package/dist/grideditor.d.ts +37 -0
- package/dist/grideditor.esm.js +1 -1
- package/dist/grideditor.js +1 -1
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +1 -1
- package/dist/locales/grideditor.es.esm.js +23 -0
- package/dist/locales/grideditor.es.js +23 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.dropdown.esm.js +2231 -0
- package/dist/plugins/grideditor.dropdown.js +2232 -0
- package/dist/plugins/grideditor.dropdown.min.js +1 -0
- package/dist/plugins/grideditor.dropdown.min.js.map +7 -0
- package/dist/plugins/grideditor.navbar.esm.js +199 -95
- package/dist/plugins/grideditor.navbar.js +199 -95
- package/dist/plugins/grideditor.navbar.min.js +1 -1
- package/dist/plugins/grideditor.navbar.min.js.map +4 -4
- package/dist/plugins/grideditor.sidenav.esm.js +199 -95
- package/dist/plugins/grideditor.sidenav.js +199 -95
- package/dist/plugins/grideditor.sidenav.min.js +1 -1
- package/dist/plugins/grideditor.sidenav.min.js.map +4 -4
- package/docs/events.md +4 -4
- package/docs/locale-keys.md +24 -1
- package/docs/plugins.md +3 -2
- package/example/containers.html +35 -1
- package/example/playground.html +1 -0
- package/package.json +1 -1
- package/src/js/locales/grideditor.es.js +23 -0
- package/src/js/nav/convert.js +6 -2
- package/src/js/nav/drawers.js +46 -14
- package/src/js/nav/dropdown.js +253 -0
- package/src/js/nav/feature.js +26 -7
- package/src/js/nav/panels.js +65 -54
- package/src/js/nav/pieces.js +52 -6
- package/src/js/plugins/grideditor.dropdown.js +335 -0
- package/src/less/grideditor.less +33 -1
- package/types/grideditor.d.ts +37 -0
|
@@ -283,7 +283,9 @@ var POSITION_CHOICES = [
|
|
|
283
283
|
];
|
|
284
284
|
|
|
285
285
|
// src/js/nav/pieces.js
|
|
286
|
-
var
|
|
286
|
+
var NAV_TYPES = ["navbar", "sidenav"];
|
|
287
|
+
var TYPES = NAV_TYPES.concat(["dropdown"]);
|
|
288
|
+
var DROPDOWN_WRAPS = ".dropdown, .dropup, .dropend, .dropstart, .btn-group";
|
|
287
289
|
var WRAPS = ".container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl";
|
|
288
290
|
var KINDS = ["nav-list", "nav-link", "nav-dropdown", "nav-menu-item", "nav-text", "nav-zone", "nav-brand"];
|
|
289
291
|
function typeOf(container) {
|
|
@@ -327,8 +329,25 @@ function panelOf(container) {
|
|
|
327
329
|
function triggerOf(container) {
|
|
328
330
|
return child(container, "button");
|
|
329
331
|
}
|
|
332
|
+
function dropdownOf(container) {
|
|
333
|
+
return children(container).filter(function(node) {
|
|
334
|
+
return is(node, DROPDOWN_WRAPS);
|
|
335
|
+
})[0] || null;
|
|
336
|
+
}
|
|
337
|
+
function isContentMenu(node) {
|
|
338
|
+
return is(node, "div.dropdown-menu");
|
|
339
|
+
}
|
|
340
|
+
function dropdownMenuOf(container) {
|
|
341
|
+
return all(container, ".dropdown-menu").filter(function(node) {
|
|
342
|
+
return isOwn(container, node);
|
|
343
|
+
})[0] || null;
|
|
344
|
+
}
|
|
330
345
|
function holderOf(container) {
|
|
331
|
-
|
|
346
|
+
var type = typeOf(container);
|
|
347
|
+
if (type === "dropdown") {
|
|
348
|
+
return dropdownOf(container);
|
|
349
|
+
}
|
|
350
|
+
return type === "sidenav" ? panelOf(container) : areaOf(container);
|
|
332
351
|
}
|
|
333
352
|
function ownerOf(node, loaded) {
|
|
334
353
|
var holder = node && node.parentElement ? node.parentElement.closest('[data-ge-container], [data-ge-nav="zone"]') : null;
|
|
@@ -369,6 +388,9 @@ function kindOf(node, loaded) {
|
|
|
369
388
|
var type = typeOf(container);
|
|
370
389
|
var parent = node.parentElement;
|
|
371
390
|
var holder = holderOf(container);
|
|
391
|
+
if (type === "dropdown") {
|
|
392
|
+
return is(node, "li") && is(parent, "ul.dropdown-menu") ? "nav-menu-item" : null;
|
|
393
|
+
}
|
|
372
394
|
if (parent === holder || type === "navbar" && parent === wrapOf(container) && is(node, ".navbar-brand")) {
|
|
373
395
|
if (isZone(node)) {
|
|
374
396
|
return "nav-zone";
|
|
@@ -431,7 +453,14 @@ function piecesOf(container, loaded) {
|
|
|
431
453
|
}
|
|
432
454
|
function isOwn(container, node) {
|
|
433
455
|
var scope = node.parentElement ? node.parentElement.closest('[data-ge-container], [data-ge-nav="zone"]') : null;
|
|
434
|
-
|
|
456
|
+
if (scope !== container) {
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
if (typeOf(container) === "dropdown") {
|
|
460
|
+
var content = node.parentElement.closest("div.dropdown-menu");
|
|
461
|
+
return !content || !container.contains(content);
|
|
462
|
+
}
|
|
463
|
+
return true;
|
|
435
464
|
}
|
|
436
465
|
function togglesOf(container) {
|
|
437
466
|
return all(container, "[data-bs-toggle], [data-ge-bs-toggle], [data-bs-dismiss], [data-ge-bs-dismiss]").filter(function(node) {
|
|
@@ -559,8 +588,9 @@ function setItemContext(item, context) {
|
|
|
559
588
|
return;
|
|
560
589
|
}
|
|
561
590
|
var own = String(from[type]).split(" ");
|
|
591
|
+
var target = String(to[type]).split(" ");
|
|
562
592
|
var rest = Array.prototype.filter.call(inner.classList, function(name) {
|
|
563
|
-
return own.indexOf(name) === -1;
|
|
593
|
+
return own.indexOf(name) === -1 && target.indexOf(name) === -1;
|
|
564
594
|
});
|
|
565
595
|
inner.className = [to[type]].concat(rest).join(" ");
|
|
566
596
|
if (type === "link") {
|
|
@@ -730,6 +760,23 @@ function browseButton(ge, context, browse, node, property, current, apply) {
|
|
|
730
760
|
return button;
|
|
731
761
|
}
|
|
732
762
|
|
|
763
|
+
// src/js/nav/dropdown.js
|
|
764
|
+
var STYLES = ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link"];
|
|
765
|
+
var STYLE_CLASS = new RegExp("^btn-(outline-)?(" + STYLES.join("|") + ")$");
|
|
766
|
+
function ownAll(container, selector) {
|
|
767
|
+
return all(container, selector).filter(function(node) {
|
|
768
|
+
return isOwn(container, node);
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
function toggleOf(container) {
|
|
772
|
+
return ownAll(container, ".dropdown-toggle")[0] || null;
|
|
773
|
+
}
|
|
774
|
+
function mainOf(container) {
|
|
775
|
+
return ownAll(container, ".btn").filter(function(node) {
|
|
776
|
+
return !hasClass(node, "dropdown-toggle");
|
|
777
|
+
})[0] || null;
|
|
778
|
+
}
|
|
779
|
+
|
|
733
780
|
// src/js/nav/drawers.js
|
|
734
781
|
var wired = /* @__PURE__ */ new WeakSet();
|
|
735
782
|
var MARKS = /^ge-nav-/;
|
|
@@ -813,8 +860,41 @@ function pickerTool(ge, drawer, title, choices) {
|
|
|
813
860
|
function add(ge, node, kind, holder) {
|
|
814
861
|
return ge.place(node, kind, { appendTo: holder, source: "tool" });
|
|
815
862
|
}
|
|
863
|
+
function itemChoices(ge, holder, context) {
|
|
864
|
+
var addItem = function(itemType2) {
|
|
865
|
+
add(ge, menuItem(ge, itemType2, context), "nav-menu-item", holder);
|
|
866
|
+
};
|
|
867
|
+
return [
|
|
868
|
+
choice(ge.t("container.nav_menu_link"), function() {
|
|
869
|
+
addItem("link");
|
|
870
|
+
}),
|
|
871
|
+
choice(ge.t("container.nav_menu_divider"), function() {
|
|
872
|
+
addItem("divider");
|
|
873
|
+
}),
|
|
874
|
+
choice(ge.t("container.nav_menu_header"), function() {
|
|
875
|
+
addItem("header");
|
|
876
|
+
}),
|
|
877
|
+
choice(ge.t("container.nav_text"), function() {
|
|
878
|
+
addItem("text");
|
|
879
|
+
})
|
|
880
|
+
];
|
|
881
|
+
}
|
|
816
882
|
function containerTools(ge, drawer, container) {
|
|
817
883
|
var type = typeOf(container);
|
|
884
|
+
if (type === "dropdown") {
|
|
885
|
+
var addButton = pickerTool(ge, drawer, ge.t("tool.add_nav_menu_item"), function() {
|
|
886
|
+
var menu = dropdownMenuOf(container);
|
|
887
|
+
return menu && !isContentMenu(menu) ? itemChoices(ge, menu, "menu") : [];
|
|
888
|
+
});
|
|
889
|
+
var held = dropdownMenuOf(container);
|
|
890
|
+
if (held && isContentMenu(held)) {
|
|
891
|
+
addButton.style.display = "none";
|
|
892
|
+
}
|
|
893
|
+
foldTool(ge, drawer, function() {
|
|
894
|
+
return dropdownOf(container);
|
|
895
|
+
});
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
818
898
|
pickerTool(ge, drawer, ge.t("tool.add_nav_piece"), function() {
|
|
819
899
|
var holder = holderOf(container);
|
|
820
900
|
return [
|
|
@@ -850,26 +930,10 @@ function addsOf(ge, node, kind, container) {
|
|
|
850
930
|
if (kind !== "nav-dropdown") {
|
|
851
931
|
return null;
|
|
852
932
|
}
|
|
853
|
-
var addItem = function(itemType2) {
|
|
854
|
-
add(ge, menuItem(ge, itemType2, isSubmenu(node) ? "submenu" : "menu"), "nav-menu-item", menuOf(node));
|
|
855
|
-
};
|
|
856
933
|
return {
|
|
857
934
|
title: ge.t("tool.add_nav_menu_item"),
|
|
858
935
|
choices: function() {
|
|
859
|
-
return
|
|
860
|
-
choice(ge.t("container.nav_menu_link"), function() {
|
|
861
|
-
addItem("link");
|
|
862
|
-
}),
|
|
863
|
-
choice(ge.t("container.nav_menu_divider"), function() {
|
|
864
|
-
addItem("divider");
|
|
865
|
-
}),
|
|
866
|
-
choice(ge.t("container.nav_menu_header"), function() {
|
|
867
|
-
addItem("header");
|
|
868
|
-
}),
|
|
869
|
-
choice(ge.t("container.nav_text"), function() {
|
|
870
|
-
addItem("text");
|
|
871
|
-
})
|
|
872
|
-
];
|
|
936
|
+
return itemChoices(ge, menuOf(node), isSubmenu(node) ? "submenu" : "menu");
|
|
873
937
|
}
|
|
874
938
|
};
|
|
875
939
|
}
|
|
@@ -878,7 +942,11 @@ function foldTool(ge, drawer, node) {
|
|
|
878
942
|
if (e) {
|
|
879
943
|
e.preventDefault();
|
|
880
944
|
}
|
|
881
|
-
var
|
|
945
|
+
var target = typeof node === "function" ? node() : node;
|
|
946
|
+
if (!target) {
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
var folded = toggleClass(target, "ge-nav-folded").classList.contains("ge-nav-folded");
|
|
882
950
|
tool.setAttribute("title", folded ? ge.t("tool.unfold_nav_menu") : ge.t("tool.fold_nav_menu"));
|
|
883
951
|
});
|
|
884
952
|
return tool;
|
|
@@ -921,6 +989,15 @@ function markContainer(ge, container, loaded) {
|
|
|
921
989
|
foldTool(ge, drawer, node);
|
|
922
990
|
}
|
|
923
991
|
});
|
|
992
|
+
if (type === "dropdown") {
|
|
993
|
+
var button = mainOf(container) || toggleOf(container);
|
|
994
|
+
if (button) {
|
|
995
|
+
editInPlace(ge, button, function() {
|
|
996
|
+
return ge.t("container.dropdown_label");
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
924
1001
|
var offcanvas = type === "navbar" ? offcanvasOf(container) : panelOf(container);
|
|
925
1002
|
var title = offcanvas ? one(offcanvas, ":scope > .offcanvas-header .offcanvas-title") : null;
|
|
926
1003
|
if (title) {
|
|
@@ -1066,79 +1143,88 @@ function setActive(container, anchor, on) {
|
|
|
1066
1143
|
function alignOf(node) {
|
|
1067
1144
|
return hasClass(node, "ms-auto") ? "end" : hasClass(node, "mx-auto") ? "center" : "after";
|
|
1068
1145
|
}
|
|
1146
|
+
function settingsOf(ge, container) {
|
|
1147
|
+
return ge.settings[typeOf(container)] || {};
|
|
1148
|
+
}
|
|
1149
|
+
function urlFieldFor(ge, context, kept, container, node, property, name, label, read, write, browseNode) {
|
|
1150
|
+
var field = textControl(write);
|
|
1151
|
+
var holder = element("div", { "class": "input-group input-group-sm" });
|
|
1152
|
+
holder.appendChild(field.control);
|
|
1153
|
+
var button = browseButton(ge, context, settingsOf(ge, container).browse, browseNode || node, property, read, function(url) {
|
|
1154
|
+
write(url);
|
|
1155
|
+
kept.render();
|
|
1156
|
+
});
|
|
1157
|
+
if (button) {
|
|
1158
|
+
holder.appendChild(button);
|
|
1159
|
+
}
|
|
1160
|
+
return {
|
|
1161
|
+
row: fieldRow(name, label, holder, field.id),
|
|
1162
|
+
render: function() {
|
|
1163
|
+
field.control.value = read();
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
function linkFieldsFor(ge, context, kept, container, node, anchor, fields) {
|
|
1168
|
+
fields.push(urlFieldFor(
|
|
1169
|
+
ge,
|
|
1170
|
+
context,
|
|
1171
|
+
kept,
|
|
1172
|
+
container,
|
|
1173
|
+
node,
|
|
1174
|
+
"href",
|
|
1175
|
+
"href",
|
|
1176
|
+
ge.t("container.nav_href"),
|
|
1177
|
+
function() {
|
|
1178
|
+
return anchor.getAttribute("href") || "";
|
|
1179
|
+
},
|
|
1180
|
+
function(value) {
|
|
1181
|
+
anchor.setAttribute("href", value);
|
|
1182
|
+
},
|
|
1183
|
+
anchor
|
|
1184
|
+
));
|
|
1185
|
+
var active = checkControl(ge.t("container.nav_active"), function(on) {
|
|
1186
|
+
setActive(container, anchor, on);
|
|
1187
|
+
kept.render();
|
|
1188
|
+
});
|
|
1189
|
+
var disabled = checkControl(ge.t("container.nav_disabled"), function(on) {
|
|
1190
|
+
toggleClass(anchor, "disabled", on);
|
|
1191
|
+
if (on) {
|
|
1192
|
+
anchor.setAttribute("aria-disabled", "true");
|
|
1193
|
+
} else {
|
|
1194
|
+
anchor.removeAttribute("aria-disabled");
|
|
1195
|
+
dropEmptyClass(anchor);
|
|
1196
|
+
}
|
|
1197
|
+
});
|
|
1198
|
+
var tab = checkControl(ge.t("container.nav_new_tab"), function(on) {
|
|
1199
|
+
if (on) {
|
|
1200
|
+
anchor.setAttribute("target", "_blank");
|
|
1201
|
+
anchor.setAttribute("rel", "noopener");
|
|
1202
|
+
} else {
|
|
1203
|
+
anchor.removeAttribute("target");
|
|
1204
|
+
anchor.removeAttribute("rel");
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
active.box.setAttribute("data-ge-nav-option", "active");
|
|
1208
|
+
disabled.box.setAttribute("data-ge-nav-option", "disabled");
|
|
1209
|
+
tab.box.setAttribute("data-ge-nav-option", "new_tab");
|
|
1210
|
+
fields.push({ row: active.box, render: function() {
|
|
1211
|
+
active.input.checked = hasClass(anchor, "active");
|
|
1212
|
+
} });
|
|
1213
|
+
fields.push({ row: disabled.box, render: function() {
|
|
1214
|
+
disabled.input.checked = hasClass(anchor, "disabled");
|
|
1215
|
+
} });
|
|
1216
|
+
fields.push({ row: tab.box, render: function() {
|
|
1217
|
+
tab.input.checked = anchor.getAttribute("target") === "_blank";
|
|
1218
|
+
} });
|
|
1219
|
+
}
|
|
1069
1220
|
function createPanels(ge, loaded) {
|
|
1070
1221
|
var kept = sectionsOf();
|
|
1071
1222
|
var context = { destroyed: false };
|
|
1072
|
-
function settingsOf(container) {
|
|
1073
|
-
return ge.settings[typeOf(container)] || {};
|
|
1074
|
-
}
|
|
1075
1223
|
function urlField(container, node, property, name, label, read, write, browseNode) {
|
|
1076
|
-
|
|
1077
|
-
var holder = element("div", { "class": "input-group input-group-sm" });
|
|
1078
|
-
holder.appendChild(field.control);
|
|
1079
|
-
var button = browseButton(ge, context, settingsOf(container).browse, browseNode || node, property, read, function(url) {
|
|
1080
|
-
write(url);
|
|
1081
|
-
kept.render();
|
|
1082
|
-
});
|
|
1083
|
-
if (button) {
|
|
1084
|
-
holder.appendChild(button);
|
|
1085
|
-
}
|
|
1086
|
-
return {
|
|
1087
|
-
row: fieldRow(name, label, holder, field.id),
|
|
1088
|
-
render: function() {
|
|
1089
|
-
field.control.value = read();
|
|
1090
|
-
}
|
|
1091
|
-
};
|
|
1224
|
+
return urlFieldFor(ge, context, kept, container, node, property, name, label, read, write, browseNode);
|
|
1092
1225
|
}
|
|
1093
1226
|
function linkFields(container, node, anchor, fields) {
|
|
1094
|
-
fields
|
|
1095
|
-
container,
|
|
1096
|
-
node,
|
|
1097
|
-
"href",
|
|
1098
|
-
"href",
|
|
1099
|
-
ge.t("container.nav_href"),
|
|
1100
|
-
function() {
|
|
1101
|
-
return anchor.getAttribute("href") || "";
|
|
1102
|
-
},
|
|
1103
|
-
function(value) {
|
|
1104
|
-
anchor.setAttribute("href", value);
|
|
1105
|
-
},
|
|
1106
|
-
anchor
|
|
1107
|
-
));
|
|
1108
|
-
var active = checkControl(ge.t("container.nav_active"), function(on) {
|
|
1109
|
-
setActive(container, anchor, on);
|
|
1110
|
-
kept.render();
|
|
1111
|
-
});
|
|
1112
|
-
var disabled = checkControl(ge.t("container.nav_disabled"), function(on) {
|
|
1113
|
-
toggleClass(anchor, "disabled", on);
|
|
1114
|
-
if (on) {
|
|
1115
|
-
anchor.setAttribute("aria-disabled", "true");
|
|
1116
|
-
} else {
|
|
1117
|
-
anchor.removeAttribute("aria-disabled");
|
|
1118
|
-
dropEmptyClass(anchor);
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
var tab = checkControl(ge.t("container.nav_new_tab"), function(on) {
|
|
1122
|
-
if (on) {
|
|
1123
|
-
anchor.setAttribute("target", "_blank");
|
|
1124
|
-
anchor.setAttribute("rel", "noopener");
|
|
1125
|
-
} else {
|
|
1126
|
-
anchor.removeAttribute("target");
|
|
1127
|
-
anchor.removeAttribute("rel");
|
|
1128
|
-
}
|
|
1129
|
-
});
|
|
1130
|
-
active.box.setAttribute("data-ge-nav-option", "active");
|
|
1131
|
-
disabled.box.setAttribute("data-ge-nav-option", "disabled");
|
|
1132
|
-
tab.box.setAttribute("data-ge-nav-option", "new_tab");
|
|
1133
|
-
fields.push({ row: active.box, render: function() {
|
|
1134
|
-
active.input.checked = hasClass(anchor, "active");
|
|
1135
|
-
} });
|
|
1136
|
-
fields.push({ row: disabled.box, render: function() {
|
|
1137
|
-
disabled.input.checked = hasClass(anchor, "disabled");
|
|
1138
|
-
} });
|
|
1139
|
-
fields.push({ row: tab.box, render: function() {
|
|
1140
|
-
tab.input.checked = anchor.getAttribute("target") === "_blank";
|
|
1141
|
-
} });
|
|
1227
|
+
linkFieldsFor(ge, context, kept, container, node, anchor, fields);
|
|
1142
1228
|
}
|
|
1143
1229
|
function dropdownFields(container, node, fields) {
|
|
1144
1230
|
var type = typeOf(container);
|
|
@@ -1586,12 +1672,13 @@ function containerBase(ge, type) {
|
|
|
1586
1672
|
}
|
|
1587
1673
|
|
|
1588
1674
|
// src/js/nav/feature.js
|
|
1589
|
-
function
|
|
1590
|
-
var selector =
|
|
1675
|
+
function holds(node, types) {
|
|
1676
|
+
var selector = types.map(function(type) {
|
|
1591
1677
|
return '[data-ge-container="' + type + '"]';
|
|
1592
1678
|
}).join(", ");
|
|
1593
1679
|
return is(node, selector) || !!one(node, selector);
|
|
1594
1680
|
}
|
|
1681
|
+
var CONTENT_MENU = '[data-ge-container="dropdown"] div.dropdown-menu';
|
|
1595
1682
|
function registerNav() {
|
|
1596
1683
|
if (GridEditor2.features.nav) {
|
|
1597
1684
|
return;
|
|
@@ -1604,20 +1691,30 @@ function registerNav() {
|
|
|
1604
1691
|
kindOf: function(node) {
|
|
1605
1692
|
return kindOf(node, loaded);
|
|
1606
1693
|
},
|
|
1607
|
-
// A free zone
|
|
1608
|
-
regions: '[data-ge-nav="zone"]',
|
|
1694
|
+
// A free zone, and the free content of a dropdown's menu, are lists rows go in, as a section is
|
|
1695
|
+
regions: '[data-ge-nav="zone"], ' + CONTENT_MENU,
|
|
1609
1696
|
/**
|
|
1610
1697
|
* A zone takes rows and nothing else, and no navbar or sidenav
|
|
1611
1698
|
* at any depth: not in it, not in a column of it, and not in a
|
|
1612
|
-
* row that holds one.
|
|
1699
|
+
* row that holds one. The free content of a dropdown's menu takes
|
|
1700
|
+
* rows too, and none that holds a dropdown as well: Bootstrap has
|
|
1701
|
+
* no menus inside menus.
|
|
1613
1702
|
*/
|
|
1614
1703
|
accepts: function(region, node) {
|
|
1615
1704
|
if (isZone(region) && !is(node, ".row")) {
|
|
1616
1705
|
return false;
|
|
1617
1706
|
}
|
|
1618
|
-
if (region.closest && region.closest('[data-ge-nav="zone"]') &&
|
|
1707
|
+
if (region.closest && region.closest('[data-ge-nav="zone"]') && holds(node, NAV_TYPES)) {
|
|
1619
1708
|
return false;
|
|
1620
1709
|
}
|
|
1710
|
+
if (loaded("dropdown") && region.closest && region.closest(CONTENT_MENU)) {
|
|
1711
|
+
if (is(region, CONTENT_MENU) && !is(node, ".row")) {
|
|
1712
|
+
return false;
|
|
1713
|
+
}
|
|
1714
|
+
if (holds(node, TYPES)) {
|
|
1715
|
+
return false;
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1621
1718
|
return true;
|
|
1622
1719
|
},
|
|
1623
1720
|
panelSection: function(node, kind) {
|
|
@@ -1636,6 +1733,13 @@ function registerNav() {
|
|
|
1636
1733
|
if (!loaded(typeOf(container))) {
|
|
1637
1734
|
return;
|
|
1638
1735
|
}
|
|
1736
|
+
if (typeOf(container) === "dropdown") {
|
|
1737
|
+
var own = dropdownMenuOf(container);
|
|
1738
|
+
if (own && !isContentMenu(own)) {
|
|
1739
|
+
menus.push(own);
|
|
1740
|
+
}
|
|
1741
|
+
return;
|
|
1742
|
+
}
|
|
1639
1743
|
var holder = holderOf(container);
|
|
1640
1744
|
if (holder) {
|
|
1641
1745
|
holders.push(holder);
|