| 225 | } |
| 226 | |
| 227 | function hintModification() { |
| 228 | return { |
| 229 | add(item, index) { |
| 230 | if (index) { |
| 231 | hints.splice(index, 0, item); |
| 232 | const child = $ul.children[index]; |
| 233 | if (child) { |
| 234 | $ul.insertBefore(child, $ul.children[index]); |
| 235 | } |
| 236 | return; |
| 237 | } |
| 238 | |
| 239 | hints.push(item); |
| 240 | }, |
| 241 | remove(item) { |
| 242 | const index = hints.indexOf(item); |
| 243 | if (index > -1) { |
| 244 | hints.splice(index, 1); |
| 245 | } |
| 246 | }, |
| 247 | removeIndex(index) { |
| 248 | hints.splice(index, 1); |
| 249 | }, |
| 250 | }; |
| 251 | } |
| 252 | |
| 253 | function ulAddEventListeners() { |
| 254 | window.addEventListener("resize", position); |