-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
147 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 4 additions & 13 deletions
17
src/bundle/Resources/public/js/scripts/admin.location.add.custom_url.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,30 @@ | ||
(function(global, doc) { | ||
const modal = doc.querySelector('#ez-modal--custom-url-alias'); | ||
const modal = doc.querySelector('#ibexa-modal--custom-url-alias'); | ||
|
||
if (modal) { | ||
const discardBtns = modal.querySelectorAll('[data-bs-dismiss="modal"]'); | ||
const submitBtn = modal.querySelector('[type="submit"]'); | ||
const submitBtn = modal.querySelector('#custom_url_add_add'); | ||
const input = modal.querySelector('[required="required"]'); | ||
const checkboxes = modal.querySelectorAll('.ez-field-edit--ezboolean input'); | ||
const siteRootCheckbox = modal.querySelector('[name="custom_url_add[site_root]"]'); | ||
const toggleButtonState = () => { | ||
const hasValue = input.value.trim().length !== 0; | ||
const methodName = hasValue ? 'removeAttribute' : 'setAttribute'; | ||
|
||
submitBtn[methodName]('disabled', true); | ||
}; | ||
const toggleCheckbox = (event) => { | ||
const checkbox = event.target; | ||
const methodName = checkbox.checked ? 'add' : 'remove'; | ||
|
||
checkbox.closest('.ez-data-source__label').classList[methodName]('is-checked'); | ||
}; | ||
const clearValues = () => { | ||
input.value = ''; | ||
toggleButtonState(); | ||
}; | ||
const toggleSiteAccessSelect = (event) => { | ||
const isChecked = event.target.checked; | ||
const siteAccessSelect = modal.querySelector('[name="custom_url_add[site_access]"]'); | ||
const methodName = isChecked ? 'removeAttribute' : 'setAttribute'; | ||
const siteAccessSelect = modal.querySelector('.ibexa-custom-url-from__item--siteacces .ibexa-dropdown'); | ||
|
||
siteAccessSelect[methodName]('disabled', true); | ||
siteAccessSelect.classList.toggle('ibexa-dropdown--is-disabled', isChecked); | ||
}; | ||
|
||
input.addEventListener('input', toggleButtonState, false); | ||
siteRootCheckbox.addEventListener('change', toggleSiteAccessSelect, false); | ||
checkboxes.forEach((checkbox) => checkbox.addEventListener('change', toggleCheckbox, false)); | ||
discardBtns.forEach((btn) => btn.addEventListener('click', clearValues, false)); | ||
} | ||
})(window, window.document); |
2 changes: 1 addition & 1 deletion
2
src/bundle/Resources/public/js/scripts/admin.location.add.translation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.ibexa-custom-url-from { | ||
&__item { | ||
margin-bottom: calculateRem(24px); | ||
|
||
.ibexa-dropdown, | ||
.ibexa-input-text-wrapper { | ||
width: calculateRem(352px); | ||
} | ||
} | ||
|
||
&__info-text { | ||
font-size: $ibexa-text-font-size-small; | ||
color: $ibexa-color-dark-400; | ||
|
||
&--checked { | ||
display: none; | ||
|
||
.ibexa-toggle--is-checked + & { | ||
display: block; | ||
} | ||
} | ||
|
||
&--unchecked { | ||
.ibexa-toggle--is-checked + .ibexa-custom-url-from__info-text--checked + & { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,3 +107,4 @@ | |
@import 'grid-view-item'; | ||
@import 'list-search'; | ||
@import 'search-links-form'; | ||
@import 'custom-url-form'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,6 @@ | |
padding: $modal-footer-padding; | ||
|
||
.btn { | ||
margin: 0 calculateRem(4px) 0 0; | ||
margin: 0 calculateRem(16px) 0 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/bundle/Resources/views/themes/admin/content/modal/hide_confirmation.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.