@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
|
@@ -267,7 +267,9 @@ var BACKGROUND_CHOICES = [
|
|
|
267
267
|
];
|
|
268
268
|
|
|
269
269
|
// src/js/nav/pieces.js
|
|
270
|
-
var
|
|
270
|
+
var NAV_TYPES = ["navbar", "sidenav"];
|
|
271
|
+
var TYPES = NAV_TYPES.concat(["dropdown"]);
|
|
272
|
+
var DROPDOWN_WRAPS = ".dropdown, .dropup, .dropend, .dropstart, .btn-group";
|
|
271
273
|
var WRAPS = ".container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl";
|
|
272
274
|
var KINDS = ["nav-list", "nav-link", "nav-dropdown", "nav-menu-item", "nav-text", "nav-zone", "nav-brand"];
|
|
273
275
|
function typeOf(container) {
|
|
@@ -311,8 +313,25 @@ function panelOf(container) {
|
|
|
311
313
|
function triggerOf(container) {
|
|
312
314
|
return child(container, "button");
|
|
313
315
|
}
|
|
316
|
+
function dropdownOf(container) {
|
|
317
|
+
return children(container).filter(function(node) {
|
|
318
|
+
return is(node, DROPDOWN_WRAPS);
|
|
319
|
+
})[0] || null;
|
|
320
|
+
}
|
|
321
|
+
function isContentMenu(node) {
|
|
322
|
+
return is(node, "div.dropdown-menu");
|
|
323
|
+
}
|
|
324
|
+
function dropdownMenuOf(container) {
|
|
325
|
+
return all(container, ".dropdown-menu").filter(function(node) {
|
|
326
|
+
return isOwn(container, node);
|
|
327
|
+
})[0] || null;
|
|
328
|
+
}
|
|
314
329
|
function holderOf(container) {
|
|
315
|
-
|
|
330
|
+
var type = typeOf(container);
|
|
331
|
+
if (type === "dropdown") {
|
|
332
|
+
return dropdownOf(container);
|
|
333
|
+
}
|
|
334
|
+
return type === "sidenav" ? panelOf(container) : areaOf(container);
|
|
316
335
|
}
|
|
317
336
|
function ownerOf(node, loaded) {
|
|
318
337
|
var holder = node && node.parentElement ? node.parentElement.closest('[data-ge-container], [data-ge-nav="zone"]') : null;
|
|
@@ -353,6 +372,9 @@ function kindOf(node, loaded) {
|
|
|
353
372
|
var type = typeOf(container);
|
|
354
373
|
var parent = node.parentElement;
|
|
355
374
|
var holder = holderOf(container);
|
|
375
|
+
if (type === "dropdown") {
|
|
376
|
+
return is(node, "li") && is(parent, "ul.dropdown-menu") ? "nav-menu-item" : null;
|
|
377
|
+
}
|
|
356
378
|
if (parent === holder || type === "navbar" && parent === wrapOf(container) && is(node, ".navbar-brand")) {
|
|
357
379
|
if (isZone(node)) {
|
|
358
380
|
return "nav-zone";
|
|
@@ -415,7 +437,14 @@ function piecesOf(container, loaded) {
|
|
|
415
437
|
}
|
|
416
438
|
function isOwn(container, node) {
|
|
417
439
|
var scope = node.parentElement ? node.parentElement.closest('[data-ge-container], [data-ge-nav="zone"]') : null;
|
|
418
|
-
|
|
440
|
+
if (scope !== container) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
if (typeOf(container) === "dropdown") {
|
|
444
|
+
var content = node.parentElement.closest("div.dropdown-menu");
|
|
445
|
+
return !content || !container.contains(content);
|
|
446
|
+
}
|
|
447
|
+
return true;
|
|
419
448
|
}
|
|
420
449
|
function togglesOf(container) {
|
|
421
450
|
return all(container, "[data-bs-toggle], [data-ge-bs-toggle], [data-bs-dismiss], [data-ge-bs-dismiss]").filter(function(node) {
|
|
@@ -543,8 +572,9 @@ function setItemContext(item, context) {
|
|
|
543
572
|
return;
|
|
544
573
|
}
|
|
545
574
|
var own = String(from[type]).split(" ");
|
|
575
|
+
var target = String(to[type]).split(" ");
|
|
546
576
|
var rest = Array.prototype.filter.call(inner.classList, function(name) {
|
|
547
|
-
return own.indexOf(name) === -1;
|
|
577
|
+
return own.indexOf(name) === -1 && target.indexOf(name) === -1;
|
|
548
578
|
});
|
|
549
579
|
inner.className = [to[type]].concat(rest).join(" ");
|
|
550
580
|
if (type === "link") {
|
|
@@ -714,6 +744,23 @@ function browseButton(ge, context, browse, node, property, current, apply) {
|
|
|
714
744
|
return button;
|
|
715
745
|
}
|
|
716
746
|
|
|
747
|
+
// src/js/nav/dropdown.js
|
|
748
|
+
var STYLES = ["primary", "secondary", "success", "danger", "warning", "info", "light", "dark", "link"];
|
|
749
|
+
var STYLE_CLASS = new RegExp("^btn-(outline-)?(" + STYLES.join("|") + ")$");
|
|
750
|
+
function ownAll(container, selector) {
|
|
751
|
+
return all(container, selector).filter(function(node) {
|
|
752
|
+
return isOwn(container, node);
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function toggleOf(container) {
|
|
756
|
+
return ownAll(container, ".dropdown-toggle")[0] || null;
|
|
757
|
+
}
|
|
758
|
+
function mainOf(container) {
|
|
759
|
+
return ownAll(container, ".btn").filter(function(node) {
|
|
760
|
+
return !hasClass(node, "dropdown-toggle");
|
|
761
|
+
})[0] || null;
|
|
762
|
+
}
|
|
763
|
+
|
|
717
764
|
// src/js/nav/drawers.js
|
|
718
765
|
var wired = /* @__PURE__ */ new WeakSet();
|
|
719
766
|
var MARKS = /^ge-nav-/;
|
|
@@ -797,8 +844,41 @@ function pickerTool(ge, drawer, title, choices) {
|
|
|
797
844
|
function add(ge, node, kind, holder) {
|
|
798
845
|
return ge.place(node, kind, { appendTo: holder, source: "tool" });
|
|
799
846
|
}
|
|
847
|
+
function itemChoices(ge, holder, context) {
|
|
848
|
+
var addItem = function(itemType2) {
|
|
849
|
+
add(ge, menuItem(ge, itemType2, context), "nav-menu-item", holder);
|
|
850
|
+
};
|
|
851
|
+
return [
|
|
852
|
+
choice(ge.t("container.nav_menu_link"), function() {
|
|
853
|
+
addItem("link");
|
|
854
|
+
}),
|
|
855
|
+
choice(ge.t("container.nav_menu_divider"), function() {
|
|
856
|
+
addItem("divider");
|
|
857
|
+
}),
|
|
858
|
+
choice(ge.t("container.nav_menu_header"), function() {
|
|
859
|
+
addItem("header");
|
|
860
|
+
}),
|
|
861
|
+
choice(ge.t("container.nav_text"), function() {
|
|
862
|
+
addItem("text");
|
|
863
|
+
})
|
|
864
|
+
];
|
|
865
|
+
}
|
|
800
866
|
function containerTools(ge, drawer, container) {
|
|
801
867
|
var type = typeOf(container);
|
|
868
|
+
if (type === "dropdown") {
|
|
869
|
+
var addButton = pickerTool(ge, drawer, ge.t("tool.add_nav_menu_item"), function() {
|
|
870
|
+
var menu = dropdownMenuOf(container);
|
|
871
|
+
return menu && !isContentMenu(menu) ? itemChoices(ge, menu, "menu") : [];
|
|
872
|
+
});
|
|
873
|
+
var held = dropdownMenuOf(container);
|
|
874
|
+
if (held && isContentMenu(held)) {
|
|
875
|
+
addButton.style.display = "none";
|
|
876
|
+
}
|
|
877
|
+
foldTool(ge, drawer, function() {
|
|
878
|
+
return dropdownOf(container);
|
|
879
|
+
});
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
802
882
|
pickerTool(ge, drawer, ge.t("tool.add_nav_piece"), function() {
|
|
803
883
|
var holder = holderOf(container);
|
|
804
884
|
return [
|
|
@@ -834,26 +914,10 @@ function addsOf(ge, node, kind, container) {
|
|
|
834
914
|
if (kind !== "nav-dropdown") {
|
|
835
915
|
return null;
|
|
836
916
|
}
|
|
837
|
-
var addItem = function(itemType2) {
|
|
838
|
-
add(ge, menuItem(ge, itemType2, isSubmenu(node) ? "submenu" : "menu"), "nav-menu-item", menuOf(node));
|
|
839
|
-
};
|
|
840
917
|
return {
|
|
841
918
|
title: ge.t("tool.add_nav_menu_item"),
|
|
842
919
|
choices: function() {
|
|
843
|
-
return
|
|
844
|
-
choice(ge.t("container.nav_menu_link"), function() {
|
|
845
|
-
addItem("link");
|
|
846
|
-
}),
|
|
847
|
-
choice(ge.t("container.nav_menu_divider"), function() {
|
|
848
|
-
addItem("divider");
|
|
849
|
-
}),
|
|
850
|
-
choice(ge.t("container.nav_menu_header"), function() {
|
|
851
|
-
addItem("header");
|
|
852
|
-
}),
|
|
853
|
-
choice(ge.t("container.nav_text"), function() {
|
|
854
|
-
addItem("text");
|
|
855
|
-
})
|
|
856
|
-
];
|
|
920
|
+
return itemChoices(ge, menuOf(node), isSubmenu(node) ? "submenu" : "menu");
|
|
857
921
|
}
|
|
858
922
|
};
|
|
859
923
|
}
|
|
@@ -862,7 +926,11 @@ function foldTool(ge, drawer, node) {
|
|
|
862
926
|
if (e) {
|
|
863
927
|
e.preventDefault();
|
|
864
928
|
}
|
|
865
|
-
var
|
|
929
|
+
var target = typeof node === "function" ? node() : node;
|
|
930
|
+
if (!target) {
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
var folded = toggleClass(target, "ge-nav-folded").classList.contains("ge-nav-folded");
|
|
866
934
|
tool.setAttribute("title", folded ? ge.t("tool.unfold_nav_menu") : ge.t("tool.fold_nav_menu"));
|
|
867
935
|
});
|
|
868
936
|
return tool;
|
|
@@ -905,6 +973,15 @@ function markContainer(ge, container, loaded) {
|
|
|
905
973
|
foldTool(ge, drawer, node);
|
|
906
974
|
}
|
|
907
975
|
});
|
|
976
|
+
if (type === "dropdown") {
|
|
977
|
+
var button = mainOf(container) || toggleOf(container);
|
|
978
|
+
if (button) {
|
|
979
|
+
editInPlace(ge, button, function() {
|
|
980
|
+
return ge.t("container.dropdown_label");
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
908
985
|
var offcanvas = type === "navbar" ? offcanvasOf(container) : panelOf(container);
|
|
909
986
|
var title = offcanvas ? one(offcanvas, ":scope > .offcanvas-header .offcanvas-title") : null;
|
|
910
987
|
if (title) {
|
|
@@ -1050,79 +1127,88 @@ function setActive(container, anchor, on) {
|
|
|
1050
1127
|
function alignOf(node) {
|
|
1051
1128
|
return hasClass(node, "ms-auto") ? "end" : hasClass(node, "mx-auto") ? "center" : "after";
|
|
1052
1129
|
}
|
|
1130
|
+
function settingsOf(ge, container) {
|
|
1131
|
+
return ge.settings[typeOf(container)] || {};
|
|
1132
|
+
}
|
|
1133
|
+
function urlFieldFor(ge, context, kept, container, node, property, name, label, read, write, browseNode) {
|
|
1134
|
+
var field = textControl(write);
|
|
1135
|
+
var holder = element("div", { "class": "input-group input-group-sm" });
|
|
1136
|
+
holder.appendChild(field.control);
|
|
1137
|
+
var button = browseButton(ge, context, settingsOf(ge, container).browse, browseNode || node, property, read, function(url) {
|
|
1138
|
+
write(url);
|
|
1139
|
+
kept.render();
|
|
1140
|
+
});
|
|
1141
|
+
if (button) {
|
|
1142
|
+
holder.appendChild(button);
|
|
1143
|
+
}
|
|
1144
|
+
return {
|
|
1145
|
+
row: fieldRow(name, label, holder, field.id),
|
|
1146
|
+
render: function() {
|
|
1147
|
+
field.control.value = read();
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function linkFieldsFor(ge, context, kept, container, node, anchor, fields) {
|
|
1152
|
+
fields.push(urlFieldFor(
|
|
1153
|
+
ge,
|
|
1154
|
+
context,
|
|
1155
|
+
kept,
|
|
1156
|
+
container,
|
|
1157
|
+
node,
|
|
1158
|
+
"href",
|
|
1159
|
+
"href",
|
|
1160
|
+
ge.t("container.nav_href"),
|
|
1161
|
+
function() {
|
|
1162
|
+
return anchor.getAttribute("href") || "";
|
|
1163
|
+
},
|
|
1164
|
+
function(value) {
|
|
1165
|
+
anchor.setAttribute("href", value);
|
|
1166
|
+
},
|
|
1167
|
+
anchor
|
|
1168
|
+
));
|
|
1169
|
+
var active = checkControl(ge.t("container.nav_active"), function(on) {
|
|
1170
|
+
setActive(container, anchor, on);
|
|
1171
|
+
kept.render();
|
|
1172
|
+
});
|
|
1173
|
+
var disabled = checkControl(ge.t("container.nav_disabled"), function(on) {
|
|
1174
|
+
toggleClass(anchor, "disabled", on);
|
|
1175
|
+
if (on) {
|
|
1176
|
+
anchor.setAttribute("aria-disabled", "true");
|
|
1177
|
+
} else {
|
|
1178
|
+
anchor.removeAttribute("aria-disabled");
|
|
1179
|
+
dropEmptyClass(anchor);
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
var tab = checkControl(ge.t("container.nav_new_tab"), function(on) {
|
|
1183
|
+
if (on) {
|
|
1184
|
+
anchor.setAttribute("target", "_blank");
|
|
1185
|
+
anchor.setAttribute("rel", "noopener");
|
|
1186
|
+
} else {
|
|
1187
|
+
anchor.removeAttribute("target");
|
|
1188
|
+
anchor.removeAttribute("rel");
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
active.box.setAttribute("data-ge-nav-option", "active");
|
|
1192
|
+
disabled.box.setAttribute("data-ge-nav-option", "disabled");
|
|
1193
|
+
tab.box.setAttribute("data-ge-nav-option", "new_tab");
|
|
1194
|
+
fields.push({ row: active.box, render: function() {
|
|
1195
|
+
active.input.checked = hasClass(anchor, "active");
|
|
1196
|
+
} });
|
|
1197
|
+
fields.push({ row: disabled.box, render: function() {
|
|
1198
|
+
disabled.input.checked = hasClass(anchor, "disabled");
|
|
1199
|
+
} });
|
|
1200
|
+
fields.push({ row: tab.box, render: function() {
|
|
1201
|
+
tab.input.checked = anchor.getAttribute("target") === "_blank";
|
|
1202
|
+
} });
|
|
1203
|
+
}
|
|
1053
1204
|
function createPanels(ge, loaded) {
|
|
1054
1205
|
var kept = sectionsOf();
|
|
1055
1206
|
var context = { destroyed: false };
|
|
1056
|
-
function settingsOf(container) {
|
|
1057
|
-
return ge.settings[typeOf(container)] || {};
|
|
1058
|
-
}
|
|
1059
1207
|
function urlField(container, node, property, name, label, read, write, browseNode) {
|
|
1060
|
-
|
|
1061
|
-
var holder = element("div", { "class": "input-group input-group-sm" });
|
|
1062
|
-
holder.appendChild(field.control);
|
|
1063
|
-
var button = browseButton(ge, context, settingsOf(container).browse, browseNode || node, property, read, function(url) {
|
|
1064
|
-
write(url);
|
|
1065
|
-
kept.render();
|
|
1066
|
-
});
|
|
1067
|
-
if (button) {
|
|
1068
|
-
holder.appendChild(button);
|
|
1069
|
-
}
|
|
1070
|
-
return {
|
|
1071
|
-
row: fieldRow(name, label, holder, field.id),
|
|
1072
|
-
render: function() {
|
|
1073
|
-
field.control.value = read();
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1208
|
+
return urlFieldFor(ge, context, kept, container, node, property, name, label, read, write, browseNode);
|
|
1076
1209
|
}
|
|
1077
1210
|
function linkFields(container, node, anchor, fields) {
|
|
1078
|
-
fields
|
|
1079
|
-
container,
|
|
1080
|
-
node,
|
|
1081
|
-
"href",
|
|
1082
|
-
"href",
|
|
1083
|
-
ge.t("container.nav_href"),
|
|
1084
|
-
function() {
|
|
1085
|
-
return anchor.getAttribute("href") || "";
|
|
1086
|
-
},
|
|
1087
|
-
function(value) {
|
|
1088
|
-
anchor.setAttribute("href", value);
|
|
1089
|
-
},
|
|
1090
|
-
anchor
|
|
1091
|
-
));
|
|
1092
|
-
var active = checkControl(ge.t("container.nav_active"), function(on) {
|
|
1093
|
-
setActive(container, anchor, on);
|
|
1094
|
-
kept.render();
|
|
1095
|
-
});
|
|
1096
|
-
var disabled = checkControl(ge.t("container.nav_disabled"), function(on) {
|
|
1097
|
-
toggleClass(anchor, "disabled", on);
|
|
1098
|
-
if (on) {
|
|
1099
|
-
anchor.setAttribute("aria-disabled", "true");
|
|
1100
|
-
} else {
|
|
1101
|
-
anchor.removeAttribute("aria-disabled");
|
|
1102
|
-
dropEmptyClass(anchor);
|
|
1103
|
-
}
|
|
1104
|
-
});
|
|
1105
|
-
var tab = checkControl(ge.t("container.nav_new_tab"), function(on) {
|
|
1106
|
-
if (on) {
|
|
1107
|
-
anchor.setAttribute("target", "_blank");
|
|
1108
|
-
anchor.setAttribute("rel", "noopener");
|
|
1109
|
-
} else {
|
|
1110
|
-
anchor.removeAttribute("target");
|
|
1111
|
-
anchor.removeAttribute("rel");
|
|
1112
|
-
}
|
|
1113
|
-
});
|
|
1114
|
-
active.box.setAttribute("data-ge-nav-option", "active");
|
|
1115
|
-
disabled.box.setAttribute("data-ge-nav-option", "disabled");
|
|
1116
|
-
tab.box.setAttribute("data-ge-nav-option", "new_tab");
|
|
1117
|
-
fields.push({ row: active.box, render: function() {
|
|
1118
|
-
active.input.checked = hasClass(anchor, "active");
|
|
1119
|
-
} });
|
|
1120
|
-
fields.push({ row: disabled.box, render: function() {
|
|
1121
|
-
disabled.input.checked = hasClass(anchor, "disabled");
|
|
1122
|
-
} });
|
|
1123
|
-
fields.push({ row: tab.box, render: function() {
|
|
1124
|
-
tab.input.checked = anchor.getAttribute("target") === "_blank";
|
|
1125
|
-
} });
|
|
1211
|
+
linkFieldsFor(ge, context, kept, container, node, anchor, fields);
|
|
1126
1212
|
}
|
|
1127
1213
|
function dropdownFields(container, node, fields) {
|
|
1128
1214
|
var type = typeOf(container);
|
|
@@ -1570,12 +1656,13 @@ function containerBase(ge, type) {
|
|
|
1570
1656
|
}
|
|
1571
1657
|
|
|
1572
1658
|
// src/js/nav/feature.js
|
|
1573
|
-
function
|
|
1574
|
-
var selector =
|
|
1659
|
+
function holds(node, types) {
|
|
1660
|
+
var selector = types.map(function(type) {
|
|
1575
1661
|
return '[data-ge-container="' + type + '"]';
|
|
1576
1662
|
}).join(", ");
|
|
1577
1663
|
return is(node, selector) || !!one(node, selector);
|
|
1578
1664
|
}
|
|
1665
|
+
var CONTENT_MENU = '[data-ge-container="dropdown"] div.dropdown-menu';
|
|
1579
1666
|
function registerNav() {
|
|
1580
1667
|
if (GridEditor2.features.nav) {
|
|
1581
1668
|
return;
|
|
@@ -1588,20 +1675,30 @@ function registerNav() {
|
|
|
1588
1675
|
kindOf: function(node) {
|
|
1589
1676
|
return kindOf(node, loaded);
|
|
1590
1677
|
},
|
|
1591
|
-
// A free zone
|
|
1592
|
-
regions: '[data-ge-nav="zone"]',
|
|
1678
|
+
// A free zone, and the free content of a dropdown's menu, are lists rows go in, as a section is
|
|
1679
|
+
regions: '[data-ge-nav="zone"], ' + CONTENT_MENU,
|
|
1593
1680
|
/**
|
|
1594
1681
|
* A zone takes rows and nothing else, and no navbar or sidenav
|
|
1595
1682
|
* at any depth: not in it, not in a column of it, and not in a
|
|
1596
|
-
* row that holds one.
|
|
1683
|
+
* row that holds one. The free content of a dropdown's menu takes
|
|
1684
|
+
* rows too, and none that holds a dropdown as well: Bootstrap has
|
|
1685
|
+
* no menus inside menus.
|
|
1597
1686
|
*/
|
|
1598
1687
|
accepts: function(region, node) {
|
|
1599
1688
|
if (isZone(region) && !is(node, ".row")) {
|
|
1600
1689
|
return false;
|
|
1601
1690
|
}
|
|
1602
|
-
if (region.closest && region.closest('[data-ge-nav="zone"]') &&
|
|
1691
|
+
if (region.closest && region.closest('[data-ge-nav="zone"]') && holds(node, NAV_TYPES)) {
|
|
1603
1692
|
return false;
|
|
1604
1693
|
}
|
|
1694
|
+
if (loaded("dropdown") && region.closest && region.closest(CONTENT_MENU)) {
|
|
1695
|
+
if (is(region, CONTENT_MENU) && !is(node, ".row")) {
|
|
1696
|
+
return false;
|
|
1697
|
+
}
|
|
1698
|
+
if (holds(node, TYPES)) {
|
|
1699
|
+
return false;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1605
1702
|
return true;
|
|
1606
1703
|
},
|
|
1607
1704
|
panelSection: function(node, kind) {
|
|
@@ -1620,6 +1717,13 @@ function registerNav() {
|
|
|
1620
1717
|
if (!loaded(typeOf(container))) {
|
|
1621
1718
|
return;
|
|
1622
1719
|
}
|
|
1720
|
+
if (typeOf(container) === "dropdown") {
|
|
1721
|
+
var own = dropdownMenuOf(container);
|
|
1722
|
+
if (own && !isContentMenu(own)) {
|
|
1723
|
+
menus.push(own);
|
|
1724
|
+
}
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1623
1727
|
var holder = holderOf(container);
|
|
1624
1728
|
if (holder) {
|
|
1625
1729
|
holders.push(holder);
|