|
236 | 236 | const addModalHeaderXBtn = document.createElement('button'); |
237 | 237 | const addModalBody = document.createElement('div'); |
238 | 238 | const addModalBodyForm = document.createElement('form'); |
| 239 | + const addModalBodyInputsWrap = document.createElement('div'); |
239 | 240 | const addModalBodySurnameInputWrap = document.createElement('div'); |
240 | 241 | const addModalBodySurnameInput = document.createElement('input'); |
241 | 242 | const addModalBodySurnameInputLabel = document.createElement('label'); |
|
250 | 251 | const addModalBodyPatronymicInput = document.createElement('input'); |
251 | 252 | const addModalBodyPatronymicInputLabel = document.createElement('label'); |
252 | 253 | const addModalBodyPatronymicFeedback = document.createElement('div'); |
| 254 | + const addModalBodyAddContactsWrap = document.createElement('div'); |
| 255 | + const addModalBodyAddSelectWrap = document.createElement('div'); |
| 256 | + const addModalBodyAddBtn = document.createElement('button'); |
| 257 | + const addModalBodyAddBtnStrokeIcon = document.createElement('span'); |
| 258 | + const addModalBodyAddBtnFillIcon = document.createElement('span'); |
| 259 | + const addModalBodyAddBtnText = document.createElement('span'); |
| 260 | + const addModalBodySaveBtn = document.createElement('button'); |
253 | 261 | const addModalFooter = document.createElement('div'); |
254 | | - const addModalFooterAddBtnWrap = document.createElement('div'); |
255 | | - const addModalFooterAddBtn = document.createElement('button'); |
256 | | - const addModalFooterAddBtnStrokeIcon = document.createElement('span'); |
257 | | - const addModalFooterAddBtnFillIcon = document.createElement('span'); |
258 | | - const addModalFooterAddBtnText = document.createElement('span'); |
259 | | - const addModalFooterSaveBtn = document.createElement('button'); |
260 | 262 | const addModalFooterCancelBtn = document.createElement('button'); |
261 | 263 |
|
262 | 264 | addBtnWrap.classList.add('crm__add-btn-wrap'); |
|
273 | 275 | addModalHeaderXBtn.classList.add('modal__add-header-x-btn', 'btn-close'); |
274 | 276 | addModalBody.classList.add('modal__add-body', 'modal-body'); |
275 | 277 | addModalBodyForm.classList.add('modal__add-body-form', 'needs-validation'); |
| 278 | + addModalBodyInputsWrap.classList.add('modal__add-body-inputs-wrap'); |
276 | 279 | addModalBodySurnameInputWrap.classList.add( |
277 | 280 | 'modal__add-body-input-wrap', |
278 | 281 | 'add-surname-input-wrap', |
|
338 | 341 | 'patronymic-input-feedback', |
339 | 342 | 'invalid-feedback' |
340 | 343 | ); |
341 | | - addModalFooter.classList.add('modal__add-footer', 'modal-footer'); |
342 | | - addModalFooterAddBtnWrap.classList.add('modal__add-footer-add-btn-wrap'); |
343 | | - addModalFooterAddBtn.classList.add( |
344 | | - 'modal__add-footer-add-btn', |
345 | | - 'modal__add-btn' |
| 344 | + addModalBodyAddContactsWrap.classList.add( |
| 345 | + 'modal__add-body-add-contacts-wrap' |
| 346 | + ); |
| 347 | + addModalBodyAddSelectWrap.classList.add( |
| 348 | + 'modal__add-body-add-select-wrap', |
| 349 | + 'd-none' |
346 | 350 | ); |
347 | | - addModalFooterAddBtnStrokeIcon.classList.add( |
348 | | - 'modal__add-footer-btn-icon', |
| 351 | + addModalBodyAddBtn.classList.add('modal__add-body-add-btn', 'modal__add-btn'); |
| 352 | + addModalBodyAddBtnStrokeIcon.classList.add( |
| 353 | + 'modal__add-body-btn-icon', |
349 | 354 | 'stroke-add-modal-icon' |
350 | 355 | ); |
351 | | - addModalFooterAddBtnFillIcon.classList.add( |
352 | | - 'modal__add-footer-btn-icon', |
| 356 | + addModalBodyAddBtnFillIcon.classList.add( |
| 357 | + 'modal__add-body-btn-icon', |
353 | 358 | 'fill-add-modal-icon' |
354 | 359 | ); |
355 | | - addModalFooterAddBtnText.classList.add('modal__add-footer-add-btn-text'); |
356 | | - addModalFooterSaveBtn.classList.add( |
357 | | - 'modal__add-footer-save-btn', |
| 360 | + addModalBodyAddBtnText.classList.add('modal__add-body-add-btn-text'); |
| 361 | + addModalBodySaveBtn.classList.add( |
| 362 | + 'modal__add-body-save-btn', |
358 | 363 | 'modal__add-btn' |
359 | 364 | ); |
| 365 | + addModalFooter.classList.add('modal__add-footer', 'modal-footer'); |
360 | 366 | addModalFooterCancelBtn.classList.add( |
361 | 367 | 'modal__add-footer-cancel-btn', |
362 | 368 | 'modal__add-btn' |
|
402 | 408 | 'for', |
403 | 409 | 'add-patronymic-floating-input' |
404 | 410 | ); |
405 | | - addModalFooterAddBtn.setAttribute('id', 'add-modal-footer-add-btn'); |
406 | | - addModalFooterAddBtn.setAttribute('type', 'button'); |
407 | | - addModalFooterSaveBtn.setAttribute('id', 'add-modal-footer-save-btn'); |
408 | | - addModalFooterSaveBtn.setAttribute('type', 'button'); |
| 411 | + addModalBodyAddBtn.setAttribute('id', 'add-modal-body-add-btn'); |
| 412 | + addModalBodyAddBtn.setAttribute('type', 'button'); |
| 413 | + addModalBodySaveBtn.setAttribute('id', 'add-modal-body-save-btn'); |
| 414 | + addModalBodySaveBtn.setAttribute('type', 'button'); |
409 | 415 | addModalFooterCancelBtn.setAttribute('id', 'add-modal-footer-cancel-btn'); |
410 | 416 | addModalFooterCancelBtn.setAttribute('type', 'button'); |
411 | 417 | addModalFooterCancelBtn.setAttribute('data-bs-dismiss', 'modal'); |
|
423 | 429 | addModalBodyPatronymicInputLabel.textContent = 'Отчество'; |
424 | 430 | addModalBodyPatronymicFeedback.textContent = |
425 | 431 | 'Введены не корректные данные.. исключите: английские буквы, цифры!'; |
426 | | - addModalFooterAddBtnText.textContent = 'Добавить контакт'; |
427 | | - addModalFooterSaveBtn.textContent = 'Сохранить'; |
| 432 | + addModalBodyAddBtnText.textContent = 'Добавить контакт'; |
| 433 | + addModalBodySaveBtn.textContent = 'Сохранить'; |
428 | 434 | addModalFooterCancelBtn.textContent = 'Отмена'; |
429 | 435 |
|
430 | 436 | addBtn.append(addBtnDefaultIcon, addBtnWhiteIcon, addBtnGrayIcon, addBtnText); |
|
447 | 453 | addModalBodyPatronymicInputLabel, |
448 | 454 | addModalBodyPatronymicFeedback |
449 | 455 | ); |
450 | | - addModalBodyForm.append( |
| 456 | + addModalBodyInputsWrap.append( |
451 | 457 | addModalBodySurnameInputWrap, |
452 | 458 | addModalBodyNameInputWrap, |
453 | 459 | addModalBodyPatronymicInputWrap |
454 | 460 | ); |
455 | | - addModalBody.append(addModalBodyForm); |
456 | | - addModalFooterAddBtn.append( |
457 | | - addModalFooterAddBtnStrokeIcon, |
458 | | - addModalFooterAddBtnFillIcon, |
459 | | - addModalFooterAddBtnText |
| 461 | + addModalBodyAddBtn.append( |
| 462 | + addModalBodyAddBtnStrokeIcon, |
| 463 | + addModalBodyAddBtnFillIcon, |
| 464 | + addModalBodyAddBtnText |
| 465 | + ); |
| 466 | + addModalBodyAddContactsWrap.append( |
| 467 | + addModalBodyAddSelectWrap, |
| 468 | + addModalBodyAddBtn |
460 | 469 | ); |
461 | | - addModalFooterAddBtnWrap.append(addModalFooterAddBtn); |
462 | | - addModalFooter.append( |
463 | | - addModalFooterAddBtnWrap, |
464 | | - addModalFooterSaveBtn, |
465 | | - addModalFooterCancelBtn |
| 470 | + addModalBodyForm.append( |
| 471 | + addModalBodyInputsWrap, |
| 472 | + addModalBodyAddContactsWrap, |
| 473 | + addModalBodySaveBtn |
466 | 474 | ); |
| 475 | + addModalBody.append(addModalBodyForm); |
| 476 | + addModalFooter.append(addModalFooterCancelBtn); |
467 | 477 | addModalContent.append(addModalHeader, addModalBody, addModalFooter); |
468 | 478 | addModalDialog.append(addModalContent); |
469 | 479 | addModalWrap.append(addModalDialog); |
|
0 commit comments