DmitrMakeev
commited on
Update buil_json.html
Browse files- buil_json.html +3 -9
buil_json.html
CHANGED
@@ -78,14 +78,10 @@
|
|
78 |
<div class="input-row">
|
79 |
<label for="title3">Название 3:</label>
|
80 |
<input type="text" id="title3" placeholder="Мега-меню">
|
81 |
-
<label for="link3">Ссылка 3:</label>
|
82 |
-
<input type="text" id="link3" placeholder="#link">
|
83 |
</div>
|
84 |
<div class="input-row">
|
85 |
<label for="title4">Название 4:</label>
|
86 |
<input type="text" id="title4" placeholder="Подменю">
|
87 |
-
<label for="link4">Ссылка 4:</label>
|
88 |
-
<input type="text" id="link4" placeholder="#link">
|
89 |
</div>
|
90 |
<button id="addMenu">Добавить меню</button>
|
91 |
</div>
|
@@ -114,16 +110,14 @@
|
|
114 |
const title2 = document.getElementById('title2').value;
|
115 |
const link2 = document.getElementById('link2').value;
|
116 |
const title3 = document.getElementById('title3').value;
|
117 |
-
const link3 = document.getElementById('link3').value;
|
118 |
const title4 = document.getElementById('title4').value;
|
119 |
-
const link4 = document.getElementById('link4').value;
|
120 |
|
121 |
-
if (title1 && link1 && title2 && link2 && title3 &&
|
122 |
menuData.menu = [
|
123 |
{ "title": title1, "link": link1 },
|
124 |
{ "title": title2, "link": link2 },
|
125 |
-
{ "title": title3, "link":
|
126 |
-
{ "title": title4, "link":
|
127 |
];
|
128 |
editor.set(menuData);
|
129 |
} else {
|
|
|
78 |
<div class="input-row">
|
79 |
<label for="title3">Название 3:</label>
|
80 |
<input type="text" id="title3" placeholder="Мега-меню">
|
|
|
|
|
81 |
</div>
|
82 |
<div class="input-row">
|
83 |
<label for="title4">Название 4:</label>
|
84 |
<input type="text" id="title4" placeholder="Подменю">
|
|
|
|
|
85 |
</div>
|
86 |
<button id="addMenu">Добавить меню</button>
|
87 |
</div>
|
|
|
110 |
const title2 = document.getElementById('title2').value;
|
111 |
const link2 = document.getElementById('link2').value;
|
112 |
const title3 = document.getElementById('title3').value;
|
|
|
113 |
const title4 = document.getElementById('title4').value;
|
|
|
114 |
|
115 |
+
if (title1 && link1 && title2 && link2 && title3 && title4) {
|
116 |
menuData.menu = [
|
117 |
{ "title": title1, "link": link1 },
|
118 |
{ "title": title2, "link": link2 },
|
119 |
+
{ "title": title3, "link": "#link" },
|
120 |
+
{ "title": title4, "link": "#link" }
|
121 |
];
|
122 |
editor.set(menuData);
|
123 |
} else {
|